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

# Overview

Use the Folders API to organize your library of queries and dashboards from code or from an AI agent. Create folder trees, rename and recolor folders, move folders, and file queries and dashboards into them. These are the same folders you see in the Dune app library, so a change made through the API appears in the app right away.

The same operations are available as tools in the [Dune MCP server](https://docs.dune.com/docs/agents/mcp.md).

## Use Cases

* **AI Agents**: Let an agent file the queries and dashboards it creates into the right folder, without manual cleanup afterwards.
* **Library Organization**: Build a folder structure for a project or a client in one script.
* **Team Workflows**: Keep team folders consistent across many members and many queries.
* **Cleanup**: Find and remove old folders and the content inside them.

## Behavior

* A folder belongs to a personal or team library. The API key decides which library you work in.
* Team folders need an editor or admin behind the API key to create, change, or delete them.
* Folder names are unique per parent folder. Creating a folder that already exists returns `409` with `folder_already_exists` and the ID of the existing folder, so a retry can use it.
* Deleting a folder that still holds content returns `409` with `folder_not_empty` and the counts, unless you pass `recursive=true`. A recursive delete archives the queries and dashboards inside, as it does in the Dune app.

> [card] [List Folders](https://docs.dune.com/api-reference/folders/endpoint/list.md)
>
> List folders at the top level or inside a parent folder, with item counts.

> [card] [Get Folder](https://docs.dune.com/api-reference/folders/endpoint/get.md)
>
> Get a folder with its subfolders, queries, and dashboards.

> [card] [Create Folder](https://docs.dune.com/api-reference/folders/endpoint/create.md)
>
> Create a folder at the top level or inside a parent folder.

> [card] [Update Folder](https://docs.dune.com/api-reference/folders/endpoint/update.md)
>
> Rename a folder or change its description, color, or icon.

> [card] [Move Folder](https://docs.dune.com/api-reference/folders/endpoint/move.md)
>
> Move a folder under another folder or to the top level.

> [card] [Delete Folder](https://docs.dune.com/api-reference/folders/endpoint/delete.md)
>
> Delete a folder, or a folder and everything inside it.

> [card] [Move Queries and Dashboards](https://docs.dune.com/api-reference/folders/endpoint/move-content.md)
>
> File queries and dashboards into a folder, or take them out of folders.


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