# Projects

## List workspace projects

`$ flora projects list`

**get** `/projects`

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

### 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

- `unnamed_schema_3: object { meta, projects }`

  - `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

```cli
flora projects list \
  --api-key 'My API Key' \
  --workspace-id ws_abc123
```

#### 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

`$ flora projects create`

**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.

### Parameters

- `--name: string`

  Project name

- `--workspace-id: string`

  Workspace identifier

### Returns

- `ProjectNewResponse: 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

```cli
flora projects create \
  --api-key 'My API Key' \
  --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

`$ flora projects retrieve`

**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.

### Parameters

- `--project-id: string`

  Project identifier

### Returns

- `ProjectGetResponse: 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

```cli
flora projects retrieve \
  --api-key 'My API Key' \
  --project-id prj_abc123
```

#### 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

`$ flora projects list-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.

### Parameters

- `--project-id: string`

  Project identifier

- `--cursor: optional string`

  Opaque cursor for fetching the next page

- `--limit: optional number`

  Maximum number of results to return

### Returns

- `unnamed_schema_4: object { canvas_url, meta, nodes, project_id }`

  - `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

```cli
flora projects list-nodes \
  --api-key 'My API Key' \
  --project-id prj_abc123
```

#### 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"
}
```

# Assets

## Attach an asset to a canvas

`$ flora projects:assets attach-asset`

**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.

### Parameters

- `--project-id: string`

  Project identifier

- `--asset-id: string`

  Asset identifier

### Returns

- `ProjectAssetAttachAssetResponse: 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

### Example

```cli
flora projects:assets attach-asset \
  --api-key 'My API Key' \
  --project-id prj_abc123 \
  --asset-id asset_abc123
```

#### Response

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

# Canvas

## Get project canvas

`$ flora projects:canvas retrieve`

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

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

### Parameters

- `--project-id: string`

  Project identifier

### Returns

- `ProjectCanvasGetResponse: 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`

### Example

```cli
flora projects:canvas retrieve \
  --api-key 'My API Key' \
  --project-id prj_abc123
```

#### 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

`$ flora projects:canvas update`

**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.

### Parameters

- `--project-id: string`

  Project identifier

- `--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.

### Returns

- `ProjectCanvasUpdateResponse: 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`

### Example

```cli
flora projects:canvas update \
  --api-key 'My API Key' \
  --project-id prj_abc123 \
  --diagram 'graph LR
  source["Product photo (Image)"]
  output["Editorial campaign image (Image)"]
  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"
  ]
}
```

# Actions

## Create a canvas action

`$ flora projects:actions create`

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

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

### Parameters

- `--project-id: string`

  Project identifier

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

  Action identifier

- `--params: optional map[unknown]`

  Action parameters

### Returns

- `ProjectActionNewResponse: 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

### Example

```cli
flora projects:actions create \
  --api-key 'My API Key' \
  --project-id prj_abc123 \
  --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

`$ flora projects:actions run`

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

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

### Parameters

- `--project-id: string`

  Project identifier

- `--node-id: string`

  Canvas action node identifier

### Returns

- `ProjectActionRunResponse: 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

### Example

```cli
flora projects:actions run \
  --api-key 'My API Key' \
  --project-id prj_abc123 \
  --node-id nodeId
```

#### 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"
  }
}
```
