# Create a folder

**POST** `/api/folders`

Makes a folder for workflows, at the top or inside another folder.

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

## Parameters

### Body

- `name` · Required · string: Up to 255 characters, trimmed. It must differ from the other folders in the same place, ignoring case.
- `parentId` · Optional · UUID: The folder to put it in. Leave it out, or send `null`, for the top level.

Request

**curl**

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

curl -X POST "$GORUNNER/api/folders" \
  -H "Authorization: Bearer $GORUNNER_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Invoices",
    "parentId": "7a2c9e41-5b3d-4f08-a6e1-2d9c4b7f0e13"
  }'
```

**JavaScript**

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

const res = await fetch(`${GORUNNER}/api/folders`, {
  method: "POST",
  headers: {
    Authorization: `Bearer ${TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    name: "Invoices",
    parentId: "7a2c9e41-5b3d-4f08-a6e1-2d9c4b7f0e13",
  }),
});
const { data } = await res.json();
```

**Python**

```python
import os, requests

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

res = requests.post(
    f"{GORUNNER}/api/folders",
    headers={"Authorization": f"Bearer {TOKEN}"},
    json={
      "name": "Invoices",
      "parentId": "7a2c9e41-5b3d-4f08-a6e1-2d9c4b7f0e13",
    },
)
data = res.json()["data"]
```

Response · 201 Created

```json
{
  "data": {
    "id": "6e9a1c3f-8b2d-4a57-9e0c-3f7b5d1a8c42",
    "name": "Invoices",
    "parentId": "7a2c9e41-5b3d-4f08-a6e1-2d9c4b7f0e13",
    "workspaceId": "c41a7e02-9b3d-4f6a-8e15-7d2c0b9a4f68",
    "orgId": "e9d2b6f1-3a7c-4d05-b8e4-1c6f2a9d7b30",
    "workflowCount": 0,
    "createdAt": "2026-10-25T09:00:00Z",
    "updatedAt": "2026-10-25T09:00:00Z"
  }
}
```

## Responses

- 201 Created

  The new folder, with `workflowCount` 0.

- 400 `VALIDATION_ERROR`

  The body isn’t JSON, the name is blank or over 255 characters, or `parentId` isn’t a folder in this workspace.

- 403 `FORBIDDEN`

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

- 409 `NAME_TAKEN`

  A folder with this name is already in that place. Names are compared without case.

- 500 `INTERNAL_ERROR`

  The folder wasn’t made. 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) · [`413 PAYLOAD_TOO_LARGE`](https://docs.gorunner.io/errors#PAYLOAD_TOO_LARGE) · [`415 INVALID_CONTENT_TYPE`](https://docs.gorunner.io/errors#INVALID_CONTENT_TYPE) · [`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).

Response · 409 Conflict

```json
{
  "error": {
    "code": "NAME_TAKEN",
    "message": "A folder named “Invoices” is already here."
  }
}
```

**Every field**

### Body

- `name` · Required · string: Required; trimmed. Blank after trimming, or longer than 255 characters, is a 400. A name a folder in the same place already has, ignoring case, is a 409 `NAME_TAKEN`.
- `parentId` · Optional · UUID: Optional parent. Omit or send null for a root folder. Must exist in the same workspace — an unknown or cross-tenant id is a 400 "Parent folder not found."

### Response · 201 Created

- `data` · object: A node in the workflow-organization tree. Folders organize workflows only — they have no relationship to connections or templates.
  - `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

**Is it safe to send again?**

No. It takes no `Idempotency-Key`. If the first call made the folder, a retry answers `409 NAME_TAKEN`; List folders shows it.

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

Source: https://docs.gorunner.io/api/folders/create-folder
