# List folders

**GET** `/api/folders`

Returns every folder in the workspace as one flat list, ordered by name.

Needs [an API token](https://docs.gorunner.io/api/authentication#scopes) with the **Read** permission for workflows (`workflow:read`).

## Request

It takes no parameters.

## Build the tree

The list is flat. Put each folder under the one its `parentId` names; a folder without one is at the top.

`workflowCount`, `liveCount` and `failingCount` count the workflows filed directly in the folder. The `total…` counts add every folder under it, at any depth.

In this list, `workspaceId` and `orgId` are all zeros. Create a folder answers them filled in.

## Responses

- 200 OK

  The folders, flat. An empty workspace answers `[]`.

- 403 `FORBIDDEN`

  The token lacks the **Read** permission for workflows.

- 500 `INTERNAL_ERROR`

  The folders couldn’t be read. Try again.

Any call can also answer: [`401 UNAUTHORIZED`](https://docs.gorunner.io/errors#UNAUTHORIZED) · [`401 TOKEN_ENDED`](https://docs.gorunner.io/errors#TOKEN_ENDED) · [`403 TOKEN_SURFACE_OFF`](https://docs.gorunner.io/errors#TOKEN_SURFACE_OFF) · [`403 FEATURE_OFF`](https://docs.gorunner.io/errors#FEATURE_OFF) · [`403 EMBED_NOT_ALLOWED`](https://docs.gorunner.io/errors#EMBED_NOT_ALLOWED) · [`403 EMBED_NOT_AVAILABLE`](https://docs.gorunner.io/errors#EMBED_NOT_AVAILABLE) · [`403 ACCOUNT_SUSPENDED`](https://docs.gorunner.io/errors#ACCOUNT_SUSPENDED) · [`429 RATE_LIMITED`](https://docs.gorunner.io/errors#RATE_LIMITED) · [`503 BUSY`](https://docs.gorunner.io/errors#BUSY) · [`503 PAUSED`](https://docs.gorunner.io/errors#PAUSED) · [`503 SERVICE_UNAVAILABLE`](https://docs.gorunner.io/errors#SERVICE_UNAVAILABLE). See [Errors](https://docs.gorunner.io/api/errors#by-status).

Request

**curl**

```bash
GORUNNER="https://api.gorunner.io"
GORUNNER_TOKEN="grt_…"  # needs Read for workflows

curl "$GORUNNER/api/folders" \
  -H "Authorization: Bearer $GORUNNER_TOKEN"
```

**JavaScript**

```js
const GORUNNER = "https://api.gorunner.io";
const TOKEN = process.env.GORUNNER_TOKEN;

const res = await fetch(`${GORUNNER}/api/folders`, {
  headers: { Authorization: `Bearer ${TOKEN}` },
});
const { data } = await res.json();
```

**Python**

```python
import os, requests

GORUNNER = "https://api.gorunner.io"
TOKEN = os.environ["GORUNNER_TOKEN"]

res = requests.get(
    f"{GORUNNER}/api/folders",
    headers={"Authorization": f"Bearer {TOKEN}"},
)
data = res.json()["data"]
```

Response · 200 OK, shortened

```json
{
  "data": [
    {
      "id": "7a2c9e41-5b3d-4f08-a6e1-2d9c4b7f0e13",
      "name": "Billing",
      "workflowCount": 2,
      "liveCount": 1,
      "failingCount": 0,
      "totalWorkflowCount": 5,
      "totalLiveCount": 3,
      "totalFailingCount": 1,
      "createdAt": "2026-10-25T09:00:00Z",
      "updatedAt": "2026-10-25T09:00:00Z"
    },
    {
      "id": "6e9a1c3f-8b2d-4a57-9e0c-3f7b5d1a8c42",
      "name": "Invoices",
      "parentId": "7a2c9e41-5b3d-4f08-a6e1-2d9c4b7f0e13",
      "workflowCount": 3,
      "liveCount": 2,
      "failingCount": 1,
      "totalWorkflowCount": 3,
      "totalLiveCount": 2,
      "totalFailingCount": 1,
      "createdAt": "2026-10-25T09:00:00Z",
      "updatedAt": "2026-10-25T09:00:00Z"
    }
  ]
}
```

**Every field**

It takes no body.

### Response · 200 OK

- `data` · array of objects
  - `id` · UUID
  - `name` · string: Trimmed of surrounding whitespace. At most 255 characters. Create and rename refuse a name a sibling already has, ignoring case (409 `NAME_TAKEN`); deleting a folder moves its children up and renames a child whose name is taken there (`<name> (2)`), so siblings never share a name.
  - `parentId` · UUID: Parent folder. Absent/null means a root folder. The list is flat — build the tree from this field.
  - `workspaceId` · UUID: Owning workspace. Populated on create; the all-zero UUID in list responses (not selected by the list query).
  - `orgId` · UUID: Owning organization. Same caveat as `workspaceId`.
  - `workflowCount` · integer: Workflows filed DIRECTLY in this folder. Does not include workflows in descendant folders.
  - `liveCount` · integer: live workflows filed directly in this folder. 0 on a create’s answer.
  - `failingCount` · integer: failing workflows filed directly in this folder (live, and the latest finished production run failed). 0 on a create’s answer.
  - `totalWorkflowCount` · integer: workflows in this folder and every folder under it, at any depth. 0 on a create’s answer.
  - `totalLiveCount` · integer: live workflows in this folder and every folder under it. 0 on a create’s answer.
  - `totalFailingCount` · integer: failing workflows in this folder and every folder under it. 0 on a create’s answer.
  - `createdAt` · time
  - `updatedAt` · time

Related: [Create a folder](https://docs.gorunner.io/api/folders/create-folder) · [Move a workflow to a folder](https://docs.gorunner.io/api/workflows/move-workflow-to-folder) · [List workflows](https://docs.gorunner.io/api/workflows/list-workflows)

Source: https://docs.gorunner.io/api/folders/list-folders
