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

# Endpoint

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

# Headers

<ParamField header="x-velt-api-key" type="string" required>
  Your API key.
</ParamField>

<ParamField header="x-velt-auth-token" type="string" required>
  Your [Auth Token](/security/auth-tokens).
</ParamField>

# Body

#### Params

<ParamField body="data" type="object" required>
  <Expandable title="properties">
    <ParamField body="organizationId" type="string" required>
      Organization ID
    </ParamField>

    <ParamField body="folders" type="Folders[]" required>
      <Expandable title="properties">
        <ParamField body="folderId" type="string" required>
          Unique identifier for the new folder
        </ParamField>

        <ParamField body="folderName" type="string">
          Name of the folder
        </ParamField>

        <ParamField body="parentFolderId" type="string">
          ID of the parent folder
        </ParamField>
      </Expandable>
    </ParamField>
  </Expandable>
</ParamField>

## **Example Requests**

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

# 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"
  }
}
```

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