»/sys/namespaces

The /sys/namespaces endpoint is used manage namespaces in Vault.

»List Namespaces

This endpoints lists all the namespaces.

MethodPath
LIST/sys/namespaces

»Sample Request

$ curl \
    --header "X-Vault-Token: ..." \
    -X LIST \
    http://127.0.0.1:8200/v1/sys/namespaces

»Sample Response

["ns1/", "ns2/"]

»Create Namespace

This endpoint creates a namespace at the givent path.

MethodPath
POST/sys/namespaces/:path

»Parameters

  • path (string: <required>) – Specifies the path where the namespace will be namespace. This is specified as part of the URL.

»Sample Request

$ curl \
    --header "X-Vault-Token: ..." \
    --request POST \
    http://127.0.0.1:8200/v1/sys/namespaces/ns1

»Delete Namespace

This endpoint deletes a namespace at the specified path.

MethodPath
DELETE/sys/namespaces/:path

»Sample Request

$ curl \
    --header "X-Vault-Token: ..." \
    --request DELETE \
    http://127.0.0.1:8200/v1/sys/namespaces/ns1

»Read Namespace Information

This endpoint get the metadata for the given namespace path.

MethodPath
GET/sys/namespaces/:path

»Sample Request

$ curl \
    --header "X-Vault-Token: ..." \
    http://127.0.0.1:8200/v1/sys/namespaces/ns1

»Sample Response

{
  "id": "gsudj",
  "path": "ns1/"
}