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

# Folders API: Create, List, and Delete Folders in Dohoo

> Use the Dohoo Folders API to create, list, rename, and delete folders that organize your uploaded media files by campaign or project.

The Dohoo Folders API lets you create a folder structure inside your media library so you can keep your uploads organized by campaign, client, platform, or any other convention that fits your workflow. Each folder can hold any number of uploaded files, and you can list, rename, or delete folders at any time.

<Note>
  All Folders API requests require your API key in the `X-API-Key` header.

  ```
  X-API-Key: dh_live_xxxxxxxxxxxxxxxxxxxxxxxx
  ```
</Note>

***

## List all folders

<br />

`GET /api/upload/folders`

Returns a list of all folders in your account, including their IDs and names.

```bash theme={null}
curl https://dohoo.ai/api/upload/folders \
  -H "X-API-Key: dh_live_xxxx"
```

***

## Create a folder

<br />

`POST /api/upload/folders`

Creates a new folder with the name you provide. The response includes the new folder's `id`, which you'll use when listing its contents, renaming it, or deleting it.

**Request body**

<ParamField body="name" type="string" required>
  The display name for the new folder (e.g. `Campaign Q1`).
</ParamField>

```bash theme={null}
curl -X POST https://dohoo.ai/api/upload/folders \
  -H "X-API-Key: dh_live_xxxx" \
  -H "Content-Type: application/json" \
  -d '{"name": "Campaign Q1"}'
```

***

## List files in a folder

<br />

`GET /api/upload/folders/{folderId}/files`

Returns all files stored inside a specific folder.

<ParamField path="folderId" type="string" required>
  The unique identifier of the folder whose files you want to list.
</ParamField>

```bash theme={null}
curl https://dohoo.ai/api/upload/folders/folder_abc123/files \
  -H "X-API-Key: dh_live_xxxx"
```

***

## Rename a folder

<br />

`PATCH /api/upload/folders/{folderId}`

Updates the display name of an existing folder. Only the `name` field is updated — the folder's contents and ID remain unchanged.

<ParamField path="folderId" type="string" required>
  The unique identifier of the folder to rename.
</ParamField>

<ParamField body="name" type="string" required>
  The new display name for the folder.
</ParamField>

```bash theme={null}
curl -X PATCH https://dohoo.ai/api/upload/folders/folder_abc123 \
  -H "X-API-Key: dh_live_xxxx" \
  -H "Content-Type: application/json" \
  -d '{"name": "Campaign Q2"}'
```

***

## Delete a folder

<br />

`DELETE /api/upload/folders/{folderId}`

Deletes a folder from your account.

<ParamField path="folderId" type="string" required>
  The unique identifier of the folder to delete.
</ParamField>

```bash theme={null}
curl -X DELETE https://dohoo.ai/api/upload/folders/folder_abc123 \
  -H "X-API-Key: dh_live_xxxx"
```

<Warning>
  Deleting a folder permanently deletes **all files inside it** as well. This action cannot be undone. Make sure you no longer need any of the files the folder contains before deleting it.
</Warning>
