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);curl -X POST 'https://app.flora.ai/api/v1/workspaces/<workspaceId>/folders' \ -H 'Authorization: Bearer $FLORA_API_KEY' \ -H 'Content-Type: application/json' \ -d '{ "name": "FLORA Agent"}'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.
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ” workspaceId
required
Workspace identifier
string
Workspace identifier
Request Body required
Section titled “Request Body required ” Media type application/json
object
name
required
Folder name
string
Responses
Section titled “ Responses ”Folder returned (created or pre-existing).
Media type application/json
object
folder_id
required
Project folder identifier
string
name
required
Folder name
string
workspace_id
required
Workspace identifier
string
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"}