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

# Delete Folder

> Delete a folder from 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>

Delete a folder you created. A folder that still contains **parsed** videos cannot be deleted — move or delete those videos first. Unparsed/failed videos in the folder are removed together with it. The built-in Default folder (`-1`) and legacy API folder (`-2`) cannot be deleted.

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

## Request Example

<Note>Uses `application/x-www-form-urlencoded` — send `folder_id` as a form field.</Note>

```python theme={null}
import requests

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

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

## Parameters

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

## Response Example

```json theme={null}
{
    "code": "0000",
    "msg": "success",
    "data": null
}
```

## Response Fields

<ResponseField name="code" type="string">Business status code. `0000` indicates success.</ResponseField>
<ResponseField name="msg" type="string">Human-readable status message.</ResponseField>

## Notes & Limits

* If the folder contains a video with status `PARSE`, deletion is rejected with `Data in the current folder cannot be deleted`. Move parsed videos out with [Move Videos](/visual-search/move-videos-to-folder) first.
* A folder that does not belong to your account returns `Folder does not exist or does not belong to the current user`.
* Passing `folder_id` `<= 0` returns an error — the default/virtual folders are not deletable.


## OpenAPI

````yaml POST /serve/api/v1/folders/delete
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/delete:
    post:
      summary: Delete Folder
      operationId: delete_folder
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              required:
                - folder_id
              properties:
                folder_id:
                  type: integer
                  example: 671631448308117500
                  description: >-
                    Folder id to delete. Must be > 0 and belong to your account.
                    Fails if it contains parsed videos.
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenericJsonResponse'
components:
  schemas:
    GenericJsonResponse:
      type: object
      properties:
        code:
          type:
            - string
            - integer
          example: '0000'
        msg:
          type: string
          example: success
        data:
          oneOf:
            - type: object
              additionalProperties: true
            - type: array
              items:
                type: object
                additionalProperties: true
            - type: string
            - type: 'null'
        success:
          type: boolean
          example: true
        failed:
          type: boolean
          example: false
      additionalProperties: true
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization

````