> ## Documentation Index
> Fetch the complete documentation index at: https://api-tools.memories.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Rename Folder

> Rename an existing folder in your Private Video Library.

<Info>
  **Product**: Visual Search
  **Use case**: Organize your indexed videos into folders and scope uploads/searches to a folder
  **Host**: `https://api.memories.ai/serve/api/v1`
  **Auth**: `Authorization: sk-mavi-...` (no `Bearer` prefix)
</Info>

Rename an existing folder. Only folders you created can be renamed — the built-in Default folder (`-1`) and the legacy API folder (`-2`) cannot.

## Prerequisites

* You have [created a memories.ai API key](/visual-search/create-your-key).
* You have a folder id from [List Folders](/visual-search/list-folders) or [Create Folder](/visual-search/create-folder).

## Request Example

<Note>Uses `application/x-www-form-urlencoded` — send `folder_id` and `new_name` as form fields.</Note>

```python theme={null}
import requests

headers = {"Authorization": "sk-mavi-..."}
response = requests.post(
    "https://api.memories.ai/serve/api/v1/folders/rename",
    headers=headers,
    data={"folder_id": 671631448308117504, "new_name": "renamed-project"},
)
print(response.json())
```

```bash cURL theme={null}
curl -X POST "https://api.memories.ai/serve/api/v1/folders/rename" \
  -H "Authorization: sk-mavi-..." \
  -d "folder_id=671631448308117504" \
  -d "new_name=renamed-project"
```

## Parameters

<ParamField body="folder_id" type="integer" required>
  Id of the folder to rename. Must be **> 0** and belong to your account. The Default folder (`-1`) and legacy API folder (`-2`) cannot be renamed.
</ParamField>

<ParamField body="new_name" type="string" required>
  New folder name. Maximum **100 characters**. Must not collide with an existing folder name in your account.
</ParamField>

## Response Example

```json theme={null}
{
    "code": "0000",
    "msg": "success",
    "data": {
        "folder_id": 671631448308117504,
        "folder_name": "renamed-project"
    }
}
```

## Response Fields

<ResponseField name="code" type="string">Business status code. `0000` indicates success.</ResponseField>
<ResponseField name="msg" type="string">Human-readable status message.</ResponseField>
<ResponseField name="data.folder_id" type="integer">Identifier of the renamed folder (unchanged).</ResponseField>
<ResponseField name="data.folder_name" type="string">The new folder name.</ResponseField>

## Notes & Limits

* Passing `folder_id` `<= 0` returns an error — the default/virtual folders are not renamable.
* A folder that does not belong to your account returns `Folder does not exist or does not belong to the current user`.
* Renaming to an existing name returns `Folder with this name already exists`.


## OpenAPI

````yaml POST /serve/api/v1/folders/rename
openapi: 3.1.0
info:
  title: Memories Platform API (Docs Mapping)
  version: v1
  description: OpenAPI mapping used by Mintlify Try it for the platform docs.
servers:
  - url: https://api.memories.ai
security:
  - ApiKeyAuth: []
paths:
  /serve/api/v1/folders/rename:
    post:
      summary: Rename Folder
      operationId: rename_folder
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              required:
                - folder_id
                - new_name
              properties:
                folder_id:
                  type: integer
                  example: 671631448308117500
                  description: Folder id to rename. Must be > 0 and belong to your account.
                new_name:
                  type: string
                  maxLength: 100
                  example: renamed-project
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FolderItemResponse'
components:
  schemas:
    FolderItemResponse:
      type: object
      properties:
        code:
          type: string
          example: '0000'
        msg:
          type: string
          example: success
        data:
          $ref: '#/components/schemas/FolderItem'
    FolderItem:
      type: object
      properties:
        folder_id:
          type: integer
          example: 671631448308117500
          description: >-
            Folder identifier. -1 = Default folder; -2 = legacy API folder
            (read-only).
        folder_name:
          type: string
          example: my-project
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization

````