# list_folders

Source: https://modulify.ai/docs/api/folders/list-folders

Lists the folders in a workspace with the name, slug, position, creator and a stored count of the sites in each.

- Title: List folders
- Scope: `sites:read`
- Access: Read only
- Endpoint: `POST /v1/list_folders`

Folders group sites in the dashboard. A site sits in at most one, and a folder only ever holds sites from its own workspace. The folders come back in their dashboard order, and the built-in Archive is not a folder, so it is not listed.

The site count is stored rather than counted on each call, and it leaves out deleted sites, so treat it as an indication rather than a live total.

Start here before moving anything, because `rename_folder`, `update_folder_slug`, `move_sites_to_folder`, `reorder_folders`, `delete_folder` and `move_folder_to_workspace` all take a folder id from this list. See [Folders](https://modulify.ai/docs/projects/folders).

## Request

Call it with a `POST` to `https://api.modulify.ai/v1/list_folders`, sending the inputs below as a JSON object. The token needs the `sites:read` scope.

It only reads and changes nothing, so retrying it is safe.

```bash
curl -X POST https://api.modulify.ai/v1/list_folders \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"workspaceId":"WORKSPACE_ID"}'
```

Over MCP, the same method is the [list_folders tool](https://modulify.ai/docs/mcp/folders/list-folders).

## Inputs

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `workspaceId` | string | Yes | The workspace id, from `list_workspaces`. |

## Response

Every call answers with the [JSON envelope](https://modulify.ai/docs/api/requests-and-responses#the-response) of `success`, `message`, `data`, `code` and `version`. `data` holds the result described above, and on a method that returns a total, `count` carries it. The [response headers](https://modulify.ai/docs/api/requests-and-responses#headers-on-every-method-call) carry the call's `X-Request-Id` and what is left of your per-minute budget in `X-RateLimit-Limit`, `X-RateLimit-Remaining` and `X-RateLimit-Reset`. [Errors](https://modulify.ai/docs/api/errors) explains every status code a call can answer with.