> ## Documentation Index
> Fetch the complete documentation index at: https://velt.dev/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Update Folder

Use this API to:

1. update metadata of a folder within an organization.
2. move a folder and its contents to a different parent folder.

> [!WARNING]
>
> Prior to using this API, you must:
>
> * Enable advanced queries option in [the console](https://console.velt.dev/dashboard/config/appconfig)
> * Deploy v4 series of the Velt SDK.

> [!NOTE]
>
> **Automatic Folder Move Handling:** When moving a folder to a different parent by updating the `parentFolderId`, the API automatically updates the folder's `ancestors` array and `accessType`, and propagates these changes to all subfolders within the moved folder.

# Endpoint

`POST https://api.velt.dev/v2/organizations/folders/update`

# Headers

**x-velt-api-key** `string` *required*

Your API key.

**x-velt-auth-token** `string` *required*

Your [Auth Token](https://velt.dev/docs/security/auth-tokens.md).

# Body

#### Params

**data** `object` *required*

**properties**

**organizationId** `string` *required*

Organization ID

**folders** `Folders[]` *required*

**properties**

**folderId** `string` *required*

Unique identifier for the new folder

**folderName** `string`

Name of the folder

**parentFolderId** `string`

ID of the parent folder

## **Example Request**

```JSON theme={null}
{
  "data": {
    "organizationId": "yourOrganizationId",
    "folders": [
        {
          "folderId": "yourFolderId", 
          "folderName": "yourFolderName",
          "parentFolderId": "yourParentFolderId"
        }
    ]
  }
}
```

# Response

#### Success Response

```JSON theme={null}
{
   "result": {
       "status": "success",
       "message": "Folder Updated successfully.",
       "data": {
           "yourFolderId": {
               "success": true,
               "id": "yourFolderId",
               "message": "Folder Updated."
           }
       }
   }
}
```

#### Failure Response

```JSON theme={null}
{
  "error": {
    "message": "ERROR_MESSAGE",
    "status": "INVALID_ARGUMENT"
  }
}
```

```js theme={null}
{
   "result": {
       "status": "success",
       "message": "Folder Updated successfully.",
       "data": {
           "yourFolderId": {
               "success": true,
               "id": "yourFolderId",
               "message": "Folder Updated."
           }
       }
   }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.