Skip to content

Get or create a project folder

POST
/workspaces/{workspaceId}/folders
import { FloraClient } from '@flora-ai/flora';
const client = new FloraClient({ apiKey: process.env['FLORA_API_KEY'] });
const folder = await client.workspaces.folders.getOrCreate({
workspaceId: '<workspaceId>',
name: 'FLORA Agent',
});
console.log(folder);

Resolves the workspace’s shared project folder with the given name, creating it if it does not exist yet. Idempotent: repeated calls with the same name return the same folder, with created marking whether this call made it. Shared folders only — private folders are neither matched nor created. Pair with POST /workspaces/{workspace_id}/folders/{folder_id}/projects to file new projects into the folder.

Error responses use the standard error body.

workspaceId
required

Workspace identifier

string
/^ws_\S+$/

Workspace identifier

Media type application/json
object
name
required

Folder name

string
>= 1 characters

Folder returned (created or pre-existing).

Media type application/json
object
folder_id
required

Project folder identifier

string
/^fld_\S+$/
name
required

Folder name

string
workspace_id
required

Workspace identifier

string
/^ws_\S+$/
created
required

True when this call created the folder; false when it already existed

boolean
Example
{
"folder_id": "fld_abc123",
"name": "FLORA Agent",
"workspace_id": "ws_abc123"
}