> ## Documentation index
> Fetch the complete documentation index at: https://upstash.com/docs/llms.txt
> Ask it with GET https://upstash.com/docs/ask?q=<keywords or question>. Short keywords rank best.
> Use these to discover all available pages before exploring further.
> Feature requests: https://upstash.com/docs/common/help/feature-requests.md lists what users asked for and how to vote for a request or add one.
> Page rating: `GET https://upstash.com/docs/feedback?path=/docs/vector/api/endpoints/rename-namespace&helpful=true` (or `false`) records whether this page helped. An optional `comment` (URL-encoded, at most 500 characters) says what was missing or wrong. It is anonymous and needs no key. Comments hold no code, secrets or personal data.

# Rename Namespace

> Renames a namespace of an index.

`POST https://{endpoint}/rename-namespace`

<Note>
  The default namespace, which is the empty string `""`, cannot be renamed.
</Note>

<Note>
  There should not be a namespace with the given new namespace name, unless the
  delete existing flag is passed.
</Note>

## Request

<ParamField body="namespace" type="string" required>
  The name of the namespace to rename.
</ParamField>

<ParamField body="newNamespace" type="string" required>
  The new name of the namespace.
</ParamField>

<ParamField body="deleteExisting" type="boolean" default="false">
  When the delete existing flag is passed, if there exists a namespace
  with the new namespace name, it is deleted before the rename operation.
</ParamField>

## Response

<ResponseField name="renamed" type="boolean">
  Whether the namespace is renamed or not.
</ResponseField>
