• HashiCorp Developer

  • HashiCorp Cloud Platform
  • Terraform
  • Packer
  • Consul
  • Vault
  • Boundary
  • Nomad
  • Waypoint
  • Vagrant
Vault
  • Install
  • Tutorials
  • Documentation
  • API
  • Integrations
  • Try Cloud(opens in new tab)
  • Sign up
Vault Home

Documentation

Skip to main content
  • Documentation
  • What is Vault?
  • Use Cases

  • Browser Support
  • Installing Vault
    • Overview
    • agent
    • debug
    • delete
    • list
    • login
    • monitor
    • namespace
    • path-help
    • read
    • server
    • ssh
    • status
    • unwrap
    • version
    • version-history
    • write
    • Token Helpers

  • Vault Integration Program
  • Vault Interoperability Matrix
  • Troubleshoot






  • Glossary


  • Resources

  • Tutorial Library
  • Certifications
  • Community Forum
    (opens in new tab)
  • Support
    (opens in new tab)
  • GitHub
    (opens in new tab)
  1. Developer
  2. Vault
  3. Documentation
  4. Commands (CLI)
  5. namespace
  • Vault
  • v1.11.x
  • v1.10.x
  • v1.9.x
  • v1.8.x
  • v1.7.x
  • v1.6.x
  • v1.5.x
  • v1.4.x

»namespace

The namespace command groups subcommands for interacting with namespaces.

Examples

List all namespaces:

$ vault namespace list

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

$ vault namespace create ns1/

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

$ 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

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

Delete the namespace at path ns1/:

$ vault namespace delete ns1/

Lookup the namespace information at path ns1/:

$ vault namespace lookup ns1/

Lock the API for the current namespace:

$ vault namespace lock

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

$ vault namespace lock ns1/

Unlock the API for the current namespace:

$ vault namespace unlock -unlock-key <unlock key>

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

$ vault namespace unlock -unlock-key <unlock key> ns1/

Usage

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.

Edit this page on GitHub

On this page

  1. namespace
  2. Examples
  3. Usage
Give Feedback(opens in new tab)
  • Certifications
  • System Status
  • Terms of Use
  • Security
  • Privacy
  • Trademark Policy
  • Trade Controls
  • Give Feedback(opens in new tab)