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

# Delete Folder

Delete a folder and all its contents (documents and subfolders).

<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/v2/organizations/folders/delete`

# 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

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

    <ParamField body="folderId" type="string" required>
      ID of the folder to delete.
    </ParamField>
  </Expandable>
</ParamField>

## **Example Request**

```JSON theme={null}
{
   "data": {
       "organizationId": "org10",
       "folderId": "folderId2"
   }
}
```

# Response

#### Success Response

```JSON theme={null}
{
   "result": {
       "status": "success",
       "message": "Folder deletion initiated successfully.",
       "data": null
   }
}
```

#### Failure Response

```JSON theme={null}
{
   "error": {
       "code": "not-found",
       "message": "Folder not found."
   }
}
```

<ResponseExample>
  ```js theme={null}
  {
     "result": {
         "status": "success",
         "message": "Folder deletion initiated successfully.",
         "data": null
     }
  }
  ```
</ResponseExample>
