Trillet AI logo

Add Flow to Folder

Put a call flow or message flow into a folder.

POSThttps://api.trillet.ai/v1/api/flow-folders/{folderId}/flows

A flow can be in only one folder. If the flow is already in another folder, it is moved: it's removed from the old folder and added to this one in a single step.

Headers

x-workspace-idstringrequired

The workspace the folder belongs to. Folders and flows in other workspaces are treated as not found.

Path Parameters

folderIdstringrequired

The _id of the folder to add the flow to.

Request Body

pathwayIdstringrequired

The _id of the call flow or message flow. It must be in the same workspace.

pathwayTypestringrequired

call or message. Must match the folder's flowType.

Response

The updated folder:

_idstring

The folder's unique identifier.

workspaceIdstring

The workspace the folder belongs to.

namestring

The folder name.

colorstring

The folder color, stored exactly as sent (default #3498db).

iconstring

The folder icon, stored exactly as sent (default folder).

flowTypestring

call or message.

pathwayModelstring

Pathway for call folders, MessagePathway for message folders. Set by the server from flowType.

pathwaysarray

The _ids of the flows in the folder.

createdAtstring

When the folder was created (ISO 8601). Folders have no updatedAt.

Errors

All folder errors use a message field, not error.

StatusBodyWhen
400{"message": "x-workspace-id header is required"}x-workspace-id missing or not a valid ID
400{"message": "Pathway type does not match folder type"}pathwayType missing or different from the folder's flowType
400{"message": "Pathway already exists in the folder"}The flow is already in this folder
404{"message": "Folder not found"}No folder with that ID in this workspace
404{"message": "Pathway not found"}No flow with that ID (of that type) in this workspace
500{"message": "..."}Unexpected server error
{
  "pathwayId": "b7b7b7b7b7b7b7b7b7b7b7b7",
  "pathwayType": "call"
}
{
  "_id": "b2b2b2b2b2b2b2b2b2b2b2b2",
  "workspaceId": "b4b4b4b4b4b4b4b4b4b4b4b4",
  "name": "Inbound Flows",
  "color": "#3B82F6",
  "icon": "folder",
  "flowType": "call",
  "pathways": [
    "b7b7b7b7b7b7b7b7b7b7b7b7"
  ],
  "pathwayModel": "Pathway",
  "createdAt": "2026-10-15T09:30:00.000Z",
  "__v": 0
}

Last updated on