Create a project in a workspace
import { FloraClient } from '@flora-ai/flora';
const client = new FloraClient({ apiKey: process.env['FLORA_API_KEY'] });
const project = await client.workspaces.projects.create({ workspaceId: '<workspaceId>', name: 'Spring Campaign',});console.log(project);curl -X POST 'https://app.flora.ai/api/v1/workspaces/<workspaceId>/projects' \ -H 'Authorization: Bearer $FLORA_API_KEY' \ -H 'Content-Type: application/json' \ -d '{ "name": "Spring Campaign"}'Creates a new Flora project in the workspace named in the path. Prefer this over POST /projects when a credential can reach more than one workspace: the destination is explicit rather than carried in the body. To file the project into a project folder, use the folder route below. Mutating public API requests support an optional Idempotency-Key header for client retries; duplicate keys within two hours return idempotency_duplicate.
Error responses use the standard error body.
Authorizations
Section titled “ Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “ Path Parameters ”Workspace identifier
Workspace identifier
Request Body required
Section titled “ Request Body required ”object
Project name
Responses
Section titled “ Responses ”Project created.
object
Project identifier
Project name
True when only the creator sees the project, rather than the whole workspace. Absent when the API cannot tell.
Workspace identifier
copying while a copy’s canvas and media are still being written; it cannot be opened yet. failed when the copy did not finish; retry or delete it in the app. Every other project is ready.
Example
{ "project_id": "prj_abc123", "name": "Spring Campaign", "workspace_id": "ws_abc123", "origin": "api", "copy_status": "copying"}