> ## 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.

# Add Folder

Use this API to create a new folder in an organization.

> [!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.

# Endpoint

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

# 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

**createOrganization** `boolean`

If set to true, a new organization will be created (if it doesn't exist) before the folder is created.

**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

**accessType** `string`

Access type for the folder. Allowed values: `organizationPrivate`, `restricted`, `public`. [Learn more](https://velt.dev/docs/key-concepts/overview.md#access-control).

## **Example Requests**

#### 1. Create folder without access type

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

#### 2. Create folder with restricted access type

```JSON theme={null}
{
  "data": {
    "organizationId": "yourOrganizationId",
    "folders": [
      {
        "folderId": "folder2025",
        "folderName": "folder2025",
        "accessType": "restricted"
      }
    ]
  }
}
```

# Response

#### Success Response

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

#### Failure Response

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

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


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