# Projects

## List workspace projects

**get** `/projects`

Returns projects in the requested workspace that are accessible to the authenticated public API key, ordered by recent activity.

### Query Parameters

- `workspace_id: string`

  Workspace identifier

- `cursor: optional string`

  Opaque cursor for fetching the next page

- `limit: optional number`

  Maximum number of results to return

- `query: optional string`

  Search query

### Returns

- `meta: object { next_cursor, total_estimate }`

  - `next_cursor: string`

    Opaque cursor for fetching the next page

  - `total_estimate: optional number`

    Estimated total matching items

- `projects: array of object { created_at, last_modified, name, 3 more }`

  - `created_at: number`

  - `last_modified: number`

  - `name: string`

    Project name

  - `origin: string`

    Project origin

  - `project_id: string`

    Project identifier

  - `workspace_id: string`

    Workspace identifier

### Example

```http
curl https://app.flora.ai/api/v1/projects \
    -H "Authorization: Bearer $FLORA_API_KEY"
```

#### Response

```json
{
  "meta": {
    "next_cursor": "eyJvZmZzZXQiOjIwfQ",
    "total_estimate": 0
  },
  "projects": [
    {
      "created_at": 0,
      "last_modified": 0,
      "name": "Spring Campaign",
      "origin": "api",
      "project_id": "prj_abc123",
      "workspace_id": "ws_abc123"
    }
  ]
}
```

## Create a project

**post** `/projects`

Creates a new Flora project in the requested workspace. Mutating public API requests support an optional Idempotency-Key header for client retries; duplicate keys within two hours return idempotency_duplicate.

### Body Parameters

- `name: string`

  Project name

- `workspace_id: string`

  Workspace identifier

### Returns

- `created_at: number`

- `last_modified: number`

- `name: string`

  Project name

- `origin: string`

  Project origin

- `project_id: string`

  Project identifier

- `workspace_id: string`

  Workspace identifier

### Example

```http
curl https://app.flora.ai/api/v1/projects \
    -H 'Content-Type: application/json' \
    -H "Authorization: Bearer $FLORA_API_KEY" \
    -d '{
          "name": "Spring Campaign",
          "workspace_id": "ws_abc123"
        }'
```

#### Response

```json
{
  "created_at": 0,
  "last_modified": 0,
  "name": "Spring Campaign",
  "origin": "api",
  "project_id": "prj_abc123",
  "workspace_id": "ws_abc123"
}
```

## Get a project

**get** `/projects/{projectId}`

Returns metadata for a single project when it is accessible to the authenticated public API key. Missing and inaccessible projects both return 404.

### Path Parameters

- `projectId: string`

  Project identifier

### Returns

- `created_at: number`

- `last_modified: number`

- `name: string`

  Project name

- `origin: string`

  Project origin

- `project_id: string`

  Project identifier

- `workspace_id: string`

  Workspace identifier

### Example

```http
curl https://app.flora.ai/api/v1/projects/$PROJECT_ID \
    -H "Authorization: Bearer $FLORA_API_KEY"
```

#### Response

```json
{
  "created_at": 0,
  "last_modified": 0,
  "name": "Spring Campaign",
  "origin": "api",
  "project_id": "prj_abc123",
  "workspace_id": "ws_abc123"
}
```

## List project canvas nodes

**get** `/projects/{projectId}/nodes`

Returns sanitized visible media nodes on a project canvas. The response omits raw graph documents, Liveblocks internals, raw Convex IDs, and unbounded node data blobs.

### Path Parameters

- `projectId: string`

  Project identifier

### Query Parameters

- `cursor: optional string`

  Opaque cursor for fetching the next page

- `limit: optional number`

  Maximum number of results to return

### Returns

- `canvas_url: string`

  Project canvas URL

- `meta: object { next_cursor, total_estimate }`

  - `next_cursor: string`

    Opaque cursor for fetching the next page

  - `total_estimate: optional number`

    Estimated total matching items

- `nodes: array of object { node_id, type, asset_id, 4 more }`

  - `node_id: string`

    Canvas node identifier

  - `type: "image" or "video" or "audio" or "text"`

    Canvas node media type

    - `"image"`

    - `"video"`

    - `"audio"`

    - `"text"`

  - `asset_id: optional string`

    Asset identifier

  - `height: optional number`

  - `label: optional string`

    Canvas node label

  - `url: optional string`

    Canvas node output URL or text content

  - `width: optional number`

- `project_id: string`

  Project identifier

### Example

```http
curl https://app.flora.ai/api/v1/projects/$PROJECT_ID/nodes \
    -H "Authorization: Bearer $FLORA_API_KEY"
```

#### Response

```json
{
  "canvas_url": "https://example.com",
  "meta": {
    "next_cursor": "eyJvZmZzZXQiOjIwfQ",
    "total_estimate": 0
  },
  "nodes": [
    {
      "node_id": "node_abc123",
      "type": "image",
      "asset_id": "asset_abc123",
      "height": 0,
      "label": "Logo",
      "url": "https://media.flora.ai/output.png",
      "width": 0
    }
  ],
  "project_id": "prj_abc123"
}
```

## Domain Types

### Project List Response

- `ProjectListResponse object { created_at, last_modified, name, 3 more }`

  - `created_at: number`

  - `last_modified: number`

  - `name: string`

    Project name

  - `origin: string`

    Project origin

  - `project_id: string`

    Project identifier

  - `workspace_id: string`

    Workspace identifier

### Project Create Response

- `ProjectCreateResponse object { created_at, last_modified, name, 3 more }`

  - `created_at: number`

  - `last_modified: number`

  - `name: string`

    Project name

  - `origin: string`

    Project origin

  - `project_id: string`

    Project identifier

  - `workspace_id: string`

    Workspace identifier

### Project Retrieve Response

- `ProjectRetrieveResponse object { created_at, last_modified, name, 3 more }`

  - `created_at: number`

  - `last_modified: number`

  - `name: string`

    Project name

  - `origin: string`

    Project origin

  - `project_id: string`

    Project identifier

  - `workspace_id: string`

    Workspace identifier

### Project List Nodes Response

- `ProjectListNodesResponse object { node_id, type, asset_id, 4 more }`

  - `node_id: string`

    Canvas node identifier

  - `type: "image" or "video" or "audio" or "text"`

    Canvas node media type

    - `"image"`

    - `"video"`

    - `"audio"`

    - `"text"`

  - `asset_id: optional string`

    Asset identifier

  - `height: optional number`

  - `label: optional string`

    Canvas node label

  - `url: optional string`

    Canvas node output URL or text content

  - `width: optional number`

# Assets

## Attach an asset to a canvas

**post** `/projects/{projectId}/assets/{assetId}/attach`

Attaches an existing ready asset to a project canvas as a static media node. Mutating public API requests support an optional Idempotency-Key header for client retries; duplicate keys within two hours return idempotency_duplicate.

### Path Parameters

- `projectId: string`

  Project identifier

- `assetId: string`

  Asset identifier

### Returns

- `asset_id: string`

  Asset identifier

- `canvas_url: string`

  Project canvas URL

- `node_id: string`

  Canvas node identifier

- `project_id: string`

  Project identifier

### Example

```http
curl https://app.flora.ai/api/v1/projects/$PROJECT_ID/assets/$ASSET_ID/attach \
    -X POST \
    -H "Authorization: Bearer $FLORA_API_KEY"
```

#### Response

```json
{
  "asset_id": "asset_abc123",
  "canvas_url": "https://example.com",
  "node_id": "node_abc123",
  "project_id": "prj_abc123"
}
```

## Domain Types

### Asset Attach Asset Response

- `AssetAttachAssetResponse object { asset_id, canvas_url, node_id, project_id }`

  - `asset_id: string`

    Asset identifier

  - `canvas_url: string`

    Project canvas URL

  - `node_id: string`

    Canvas node identifier

  - `project_id: string`

    Project identifier

# Canvas

## Get project canvas

**get** `/projects/{projectId}/canvas`

Returns the current project canvas topology as a Mermaid flowchart using the same serializer as the Fauna agent.

### Path Parameters

- `projectId: string`

  Project identifier

### Returns

- `canvas_url: string`

  Project canvas URL

- `diagram: string`

  Mermaid flowchart diagram

- `project_id: string`

  Project identifier

- `summary: object { edge_count, group_count, isolated_node_count, 2 more }`

  - `edge_count: number`

  - `group_count: number`

  - `isolated_node_count: number`

  - `node_count: number`

  - `workflow_count: number`

### Example

```http
curl https://app.flora.ai/api/v1/projects/$PROJECT_ID/canvas \
    -H "Authorization: Bearer $FLORA_API_KEY"
```

#### Response

```json
{
  "canvas_url": "https://example.com",
  "diagram": "graph LR\n  n1[\"Prompt (text)\"]\n  n2[\"Result (image)\"]\n  n1 -->|text| n2",
  "project_id": "prj_abc123",
  "summary": {
    "edge_count": 0,
    "group_count": 0,
    "isolated_node_count": 0,
    "node_count": 0,
    "workflow_count": 0
  }
}
```

## Patch project canvas

**patch** `/projects/{projectId}/canvas`

Applies a Mermaid flowchart patch to the project canvas using the same create_workflow path as the Fauna agent. The diagram may add nodes, connect nodes, and reference existing canvas nodes by their Mermaid short IDs in edges (e.g. `n1 --> out`). This endpoint is add-only: re-declaring an existing node id with a label (e.g. `n3["..."]`) creates a NEW node instead of updating the existing one, and returns a warning. To attach to an existing node, reference its id in an edge without re-declaring its label. Subgraph grouping is not applied (nodes inside a `subgraph` are added ungrouped) and returns a warning. To place an existing image/video/audio as a static node, set `node_params` — which is keyed by Mermaid node id, e.g. `{ "img1": { "content_url": "https://…" } }`, NOT a bare `{ content_url }` object. `prompt` and `content_url` are mutually exclusive for a node: use `prompt` (or a label that doubles as the prompt) for generation, or `content_url` for existing media. When using `content_url`, give the node a content-free type-only label such as `img1["(Image)"]` so no prompt is inferred from the label.

### Path Parameters

- `projectId: string`

  Project identifier

### Body Parameters

- `diagram: string`

  Mermaid flowchart diagram to apply

- `node_params: optional map[object { aspect_ratio, content_url, model, 3 more } ]`

  Optional per-node parameters, keyed by Mermaid node id (a Record<nodeId, NodeParams>), e.g. { "img1": { "content_url": "https://…" } }. Pass a map keyed by node id, NOT a bare { content_url } object.

  - `aspect_ratio: optional string`

  - `content_url: optional string`

    HTTPS URL of existing media to place as a static node. Mutually exclusive with prompt: give the node a content-free type-only label such as `(Image)` so no prompt is inferred from the label. Only supported for Image, Video, and Audio nodes.

  - `model: optional string`

  - `model_parameters: optional map[unknown]`

  - `prompt: optional string`

    Generation prompt for this node. Mutually exclusive with content_url. If omitted, the node's Mermaid label is used as the prompt.

  - `resolution: optional string`

### Returns

- `canvas_url: string`

  Project canvas URL

- `created_edge_count: number`

- `created_node_count: number`

- `diagram: string`

  Applied Mermaid flowchart diagram

- `project_id: string`

  Project identifier

- `warnings: optional array of string`

### Example

```http
curl https://app.flora.ai/api/v1/projects/$PROJECT_ID/canvas \
    -X PATCH \
    -H 'Content-Type: application/json' \
    -H "Authorization: Bearer $FLORA_API_KEY" \
    -d '{
          "diagram": "graph LR\\n  source[\\"Product photo (Image)\\"]\\n  output[\\"Editorial campaign image (Image)\\"]\\n  source --> output"
        }'
```

#### Response

```json
{
  "canvas_url": "https://example.com",
  "created_edge_count": 0,
  "created_node_count": 0,
  "diagram": "graph LR\n  n1[\"Prompt (text)\"]\n  n2[\"Result (image)\"]\n  n1 --> n2",
  "project_id": "prj_abc123",
  "warnings": [
    "string"
  ]
}
```

## Domain Types

### Canvas Retrieve Response

- `CanvasRetrieveResponse object { canvas_url, diagram, project_id, summary }`

  - `canvas_url: string`

    Project canvas URL

  - `diagram: string`

    Mermaid flowchart diagram

  - `project_id: string`

    Project identifier

  - `summary: object { edge_count, group_count, isolated_node_count, 2 more }`

    - `edge_count: number`

    - `group_count: number`

    - `isolated_node_count: number`

    - `node_count: number`

    - `workflow_count: number`

### Canvas Update Response

- `CanvasUpdateResponse object { canvas_url, created_edge_count, created_node_count, 3 more }`

  - `canvas_url: string`

    Project canvas URL

  - `created_edge_count: number`

  - `created_node_count: number`

  - `diagram: string`

    Applied Mermaid flowchart diagram

  - `project_id: string`

    Project identifier

  - `warnings: optional array of string`

# Actions

## Create a canvas action

**post** `/projects/{projectId}/actions`

Creates a prebuilt action node on a project canvas using a raw action slug.

### Path Parameters

- `projectId: string`

  Project identifier

### Body Parameters

- `action_id: "split-text" or "find-and-replace-text" or "concat-text" or 34 more`

  Action identifier

  - `"split-text"`

  - `"find-and-replace-text"`

  - `"concat-text"`

  - `"ken-burns-video"`

  - `"color-grade-image"`

  - `"change-image-ar"`

  - `"rotate-image"`

  - `"flip-image"`

  - `"color-filter-image"`

  - `"color-tint-image"`

  - `"filter-color-image"`

  - `"blur-image"`

  - `"duplicate-image"`

  - `"side-by-side-composite"`

  - `"add-shape-to-image"`

  - `"generate-shape-image"`

  - `"add-text-to-image"`

  - `"generate-text-image"`

  - `"qr-code-generator"`

  - `"stitch-videos"`

  - `"split-video"`

  - `"extract-video-frames"`

  - `"color-grade-video"`

  - `"video-to-frame-grid"`

  - `"boomerang-video"`

  - `"reverse-video"`

  - `"video-to-long-exposure"`

  - `"video-effect"`

  - `"color-filter-video"`

  - `"speed-up-video"`

  - `"slow-down-video"`

  - `"duplicate-video"`

  - `"greenscreen-video"`

  - `"resize-video"`

  - `"change-video-ar"`

  - `"split-audio-from-video"`

  - `"merge-audio-into-video"`

- `params: optional map[unknown]`

  Action parameters

### Returns

- `action_id: "split-text" or "find-and-replace-text" or "concat-text" or 34 more`

  Action identifier

  - `"split-text"`

  - `"find-and-replace-text"`

  - `"concat-text"`

  - `"ken-burns-video"`

  - `"color-grade-image"`

  - `"change-image-ar"`

  - `"rotate-image"`

  - `"flip-image"`

  - `"color-filter-image"`

  - `"color-tint-image"`

  - `"filter-color-image"`

  - `"blur-image"`

  - `"duplicate-image"`

  - `"side-by-side-composite"`

  - `"add-shape-to-image"`

  - `"generate-shape-image"`

  - `"add-text-to-image"`

  - `"generate-text-image"`

  - `"qr-code-generator"`

  - `"stitch-videos"`

  - `"split-video"`

  - `"extract-video-frames"`

  - `"color-grade-video"`

  - `"video-to-frame-grid"`

  - `"boomerang-video"`

  - `"reverse-video"`

  - `"video-to-long-exposure"`

  - `"video-effect"`

  - `"color-filter-video"`

  - `"speed-up-video"`

  - `"slow-down-video"`

  - `"duplicate-video"`

  - `"greenscreen-video"`

  - `"resize-video"`

  - `"change-video-ar"`

  - `"split-audio-from-video"`

  - `"merge-audio-into-video"`

- `canvas_url: string`

  Project canvas URL

- `node_id: string`

  Canvas action node identifier

- `project_id: string`

  Project identifier

### Example

```http
curl https://app.flora.ai/api/v1/projects/$PROJECT_ID/actions \
    -H 'Content-Type: application/json' \
    -H "Authorization: Bearer $FLORA_API_KEY" \
    -d '{
          "action_id": "split-text"
        }'
```

#### Response

```json
{
  "action_id": "split-text",
  "canvas_url": "https://example.com",
  "node_id": "node_abc123",
  "project_id": "prj_abc123"
}
```

## Run a canvas action

**post** `/projects/{projectId}/actions/{nodeId}/run`

Runs an existing canvas action node through the action execution workflow.

### Path Parameters

- `projectId: string`

  Project identifier

- `nodeId: string`

  Canvas action node identifier

### Returns

- `charged_cost: number`

  Cost charged in USD

- `estimated_seconds: number`

- `run_id: string`

  Run identifier

- `type: "generation" or "technique" or "action"`

  Run type

  - `"generation"`

  - `"technique"`

  - `"action"`

- `action: optional object { action_id }`

  - `action_id: "split-text" or "find-and-replace-text" or "concat-text" or 34 more`

    Action identifier

    - `"split-text"`

    - `"find-and-replace-text"`

    - `"concat-text"`

    - `"ken-burns-video"`

    - `"color-grade-image"`

    - `"change-image-ar"`

    - `"rotate-image"`

    - `"flip-image"`

    - `"color-filter-image"`

    - `"color-tint-image"`

    - `"filter-color-image"`

    - `"blur-image"`

    - `"duplicate-image"`

    - `"side-by-side-composite"`

    - `"add-shape-to-image"`

    - `"generate-shape-image"`

    - `"add-text-to-image"`

    - `"generate-text-image"`

    - `"qr-code-generator"`

    - `"stitch-videos"`

    - `"split-video"`

    - `"extract-video-frames"`

    - `"color-grade-video"`

    - `"video-to-frame-grid"`

    - `"boomerang-video"`

    - `"reverse-video"`

    - `"video-to-long-exposure"`

    - `"video-effect"`

    - `"color-filter-video"`

    - `"speed-up-video"`

    - `"slow-down-video"`

    - `"duplicate-video"`

    - `"greenscreen-video"`

    - `"resize-video"`

    - `"change-video-ar"`

    - `"split-audio-from-video"`

    - `"merge-audio-into-video"`

- `model: optional object { model_id }`

  - `model_id: string`

    Model identifier

- `poll_url: optional string`

  URL to poll pending/running runs or fetch completed/failed run details.

- `project_id: optional string`

  Project identifier

- `technique: optional object { name, technique_id }`

  - `name: string`

    Technique name

  - `technique_id: string`

    Technique identifier

### Example

```http
curl https://app.flora.ai/api/v1/projects/$PROJECT_ID/actions/$NODE_ID/run \
    -X POST \
    -H "Authorization: Bearer $FLORA_API_KEY"
```

#### Response

```json
{
  "charged_cost": 0,
  "estimated_seconds": 0,
  "run_id": "run_abc123",
  "type": "generation",
  "action": {
    "action_id": "split-text"
  },
  "model": {
    "model_id": "t2i-flux-2-pro"
  },
  "poll_url": "https://example.com",
  "project_id": "prj_abc123",
  "technique": {
    "name": "name",
    "technique_id": "tech_abcd1234"
  }
}
```

## Domain Types

### Action Create Response

- `ActionCreateResponse object { action_id, canvas_url, node_id, project_id }`

  - `action_id: "split-text" or "find-and-replace-text" or "concat-text" or 34 more`

    Action identifier

    - `"split-text"`

    - `"find-and-replace-text"`

    - `"concat-text"`

    - `"ken-burns-video"`

    - `"color-grade-image"`

    - `"change-image-ar"`

    - `"rotate-image"`

    - `"flip-image"`

    - `"color-filter-image"`

    - `"color-tint-image"`

    - `"filter-color-image"`

    - `"blur-image"`

    - `"duplicate-image"`

    - `"side-by-side-composite"`

    - `"add-shape-to-image"`

    - `"generate-shape-image"`

    - `"add-text-to-image"`

    - `"generate-text-image"`

    - `"qr-code-generator"`

    - `"stitch-videos"`

    - `"split-video"`

    - `"extract-video-frames"`

    - `"color-grade-video"`

    - `"video-to-frame-grid"`

    - `"boomerang-video"`

    - `"reverse-video"`

    - `"video-to-long-exposure"`

    - `"video-effect"`

    - `"color-filter-video"`

    - `"speed-up-video"`

    - `"slow-down-video"`

    - `"duplicate-video"`

    - `"greenscreen-video"`

    - `"resize-video"`

    - `"change-video-ar"`

    - `"split-audio-from-video"`

    - `"merge-audio-into-video"`

  - `canvas_url: string`

    Project canvas URL

  - `node_id: string`

    Canvas action node identifier

  - `project_id: string`

    Project identifier

### Action Run Response

- `ActionRunResponse object { charged_cost, estimated_seconds, run_id, 6 more }`

  - `charged_cost: number`

    Cost charged in USD

  - `estimated_seconds: number`

  - `run_id: string`

    Run identifier

  - `type: "generation" or "technique" or "action"`

    Run type

    - `"generation"`

    - `"technique"`

    - `"action"`

  - `action: optional object { action_id }`

    - `action_id: "split-text" or "find-and-replace-text" or "concat-text" or 34 more`

      Action identifier

      - `"split-text"`

      - `"find-and-replace-text"`

      - `"concat-text"`

      - `"ken-burns-video"`

      - `"color-grade-image"`

      - `"change-image-ar"`

      - `"rotate-image"`

      - `"flip-image"`

      - `"color-filter-image"`

      - `"color-tint-image"`

      - `"filter-color-image"`

      - `"blur-image"`

      - `"duplicate-image"`

      - `"side-by-side-composite"`

      - `"add-shape-to-image"`

      - `"generate-shape-image"`

      - `"add-text-to-image"`

      - `"generate-text-image"`

      - `"qr-code-generator"`

      - `"stitch-videos"`

      - `"split-video"`

      - `"extract-video-frames"`

      - `"color-grade-video"`

      - `"video-to-frame-grid"`

      - `"boomerang-video"`

      - `"reverse-video"`

      - `"video-to-long-exposure"`

      - `"video-effect"`

      - `"color-filter-video"`

      - `"speed-up-video"`

      - `"slow-down-video"`

      - `"duplicate-video"`

      - `"greenscreen-video"`

      - `"resize-video"`

      - `"change-video-ar"`

      - `"split-audio-from-video"`

      - `"merge-audio-into-video"`

  - `model: optional object { model_id }`

    - `model_id: string`

      Model identifier

  - `poll_url: optional string`

    URL to poll pending/running runs or fetch completed/failed run details.

  - `project_id: optional string`

    Project identifier

  - `technique: optional object { name, technique_id }`

    - `name: string`

      Technique name

    - `technique_id: string`

      Technique identifier
