> For the complete documentation index, see [llms.txt](https://docs.flora.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.flora.ai/api/reference/canvas/getprojectgraph.md).

# Get a project graph

Get a project graph with the FLORA API: GET /workspaces/{workspaceId}/projects/{projectId}/graph.

Returns the full state of a project canvas: every node's short id, node UUID, type, label, prompt, model, parameters, absolute position, generation status, current output and, for document-bearing nodes such as timelines and decks, a summary of its authored content with the document revision, plus the edges between them and a revision marker. Full documents are read per node from the node document endpoint. Short ids are persisted as part of the read, so the id reported for a node is the same on every subsequent read and is the id canvas write operations accept. The revision is opaque: an identical value means nothing this endpoint reports has changed, a different value means something has, and no ordering can be inferred from two values.

```http
GET https://app.flora.ai/api/v1/workspaces/{workspaceId}/projects/{projectId}/graph
```

* **Auth:** API key as a bearer token, `Authorization: Bearer $FLORA_API_KEY`. See [Authentication](https://docs.flora.ai/api/platform/authentication.md).
* **TypeScript SDK:** `client.projects.canvas.getGraph()`.
* **Operation ID:** `getProjectGraph`.

## Example

{% tabs %}
{% tab title="cURL" %}

```bash
curl -X GET 'https://app.flora.ai/api/v1/workspaces/ws_abc123/projects/prj_abc123/graph' \
  -H "Authorization: Bearer $FLORA_API_KEY"
```

{% endtab %}

{% tab title="TypeScript SDK" %}

```typescript
import { FloraClient } from '@flora-ai/flora';

const client = new FloraClient({ apiKey: process.env['FLORA_API_KEY'] });

const canvas = await client.projects.canvas.getGraph({
  workspaceId: 'ws_abc123',
  projectId: 'prj_abc123',
});
console.log(canvas);
```

{% endtab %}
{% endtabs %}

## Path parameters

| Name          | Type   | Required | Description                                                      |
| ------------- | ------ | -------- | ---------------------------------------------------------------- |
| `workspaceId` | string | Yes      | Workspace identifier. Pattern: `^ws_\S+$`. Example: `ws_abc123`. |
| `projectId`   | string | Yes      | Project identifier. Pattern: `^prj_\S+$`. Example: `prj_abc123`. |

## Responses

### 200: Project graph returned.

| Field                             | Type                               | Required | Description                                                                                                                                                                                                                                                                               |
| --------------------------------- | ---------------------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `project_id`                      | string                             | Yes      | Project identifier. Pattern: `^prj_\S+$`. Example: `prj_abc123`.                                                                                                                                                                                                                          |
| `canvas_url`                      | string (uri)                       | Yes      | Project canvas URL                                                                                                                                                                                                                                                                        |
| `revision`                        | string                             | Yes      | Opaque change-detection marker for the reported graph. An identical value means nothing this endpoint reports has changed; a different value means something has. It is not a counter, so no ordering can be inferred from two values. At least 1 character. Example: `4f2c8ab19e3d7c05`. |
| `nodes`                           | array of objects                   | Yes      | Complete canvas node list                                                                                                                                                                                                                                                                 |
| `nodes[].id`                      | string                             | Yes      | Short node identifier. Stable across reads and the vocabulary canvas edges use. At least 1 character. Example: `n1`.                                                                                                                                                                      |
| `nodes[].node_id`                 | string                             | Yes      | Canvas node UUID. Stable for the node's life. At least 1 character. Example: `7f6ae6da-4a0e-4a2f-9c6a-2c1c6b8d1f21`.                                                                                                                                                                      |
| `nodes[].type`                    | string                             | Yes      | Node type in agent vocabulary, for example image, video, text, model3d, action, batch, or group. At least 1 character. Example: `image`.                                                                                                                                                  |
| `nodes[].label`                   | string                             | Yes      | Node display label                                                                                                                                                                                                                                                                        |
| `nodes[].group`                   | string or null                     | No       | Direct parent group short id (n7), or null for top-level nodes and pinned labels. Use this to verify existing field membership; omitted on older API deployments.                                                                                                                         |
| `nodes[].prompt`                  | string or null                     | Yes      | Configured generation prompt, or null when the node has none                                                                                                                                                                                                                              |
| `nodes[].model`                   | string or null                     | Yes      | Configured model name, or null when the node generates nothing                                                                                                                                                                                                                            |
| `nodes[].model_id`                | string or null                     | Yes      | Configured model endpoint identifier. Preferred over model because it survives catalog renames.                                                                                                                                                                                           |
| `nodes[].params`                  | object or null                     | Yes      | Configured model parameters excluding prompt, which is reported separately. Null when the node sets none.                                                                                                                                                                                 |
| `nodes[].action`                  | object or null                     | Yes      | Action-node configuration. Null for every node type other than action.                                                                                                                                                                                                                    |
| `nodes[].action.action_id`        | string or null                     | Yes      | Prebuilt action slug the node runs, for example rotate-image. Null when the node runs custom code.                                                                                                                                                                                        |
| `nodes[].action.params`           | object or null                     | Yes      | Configured action parameter values, keyed by the snake\_case parameter ids the actions endpoints expose. Null when none are set.                                                                                                                                                          |
| `nodes[].position`                | object                             | Yes      | Absolute canvas position of the node's anchor, with parent groups resolved. Every node type except group anchors at the top-center of its box, so its visual left edge is x minus half its width; a group anchors top-left.                                                               |
| `nodes[].position.x`              | number                             | Yes      | Horizontal canvas coordinate                                                                                                                                                                                                                                                              |
| `nodes[].position.y`              | number                             | Yes      | Vertical canvas coordinate                                                                                                                                                                                                                                                                |
| `nodes[].size`                    | object                             | Yes      | The node's on-canvas footprint: the rendered box once the node has painted, else its stored or default size. With position this is the box the arrange endpoint lays out, so neighbours can be placed without guessing card sizes.                                                        |
| `nodes[].size.width`              | number                             | Yes      | Node width in canvas units. At least 0.                                                                                                                                                                                                                                                   |
| `nodes[].size.height`             | number                             | Yes      | Node height in canvas units. At least 0.                                                                                                                                                                                                                                                  |
| `nodes[].status`                  | string or null                     | Yes      | Derived generation status. Null for node types that carry no generation lifecycle, such as groups, comments, batches, routers, switches, exports, and labels. One of: `idle`, `generating`, `done`, `error`.                                                                              |
| `nodes[].error_code`              | string                             | No       | Machine-readable failure code. Present only when status is error.                                                                                                                                                                                                                         |
| `nodes[].error_message`           | string                             | No       | User-facing failure message. Present only when status is error.                                                                                                                                                                                                                           |
| `nodes[].output_url`              | string or null                     | Yes      | URL of the node's current media output, or null when it has none or its output is not externally addressable                                                                                                                                                                              |
| `nodes[].output_text`             | string or null                     | Yes      | The node's current text output, or null when it has none                                                                                                                                                                                                                                  |
| `nodes[].text`                    | string or null                     | Yes      | Annotation body for a notes or label node — the text a reader sees on the canvas, in full. Null on every node type that carries none. Distinct from output\_text, which is generated output.                                                                                              |
| `nodes[].document`                | object or null                     | Yes      | Summary of the node's authored content for document-bearing nodes (timeline), or null when the node carries no document or none has been written yet. Read the full document from the node document endpoint.                                                                             |
| `nodes[].document.kind`           | string                             | Yes      | Document kind, for example "timeline". Kinds you do not recognise may appear on newer nodes: keep the wrapper and ignore the body.                                                                                                                                                        |
| `nodes[].document.schema_version` | integer                            | Yes      | Version of the document schema the body follows                                                                                                                                                                                                                                           |
| `nodes[].document.revision`       | integer                            | Yes      | Revision of this node's document. Pass it as base\_revision on a changeset update to reject a stale write.                                                                                                                                                                                |
| `nodes[].document.updated_at`     | integer                            | No       | Last document write, Unix milliseconds; absent for Deck documents                                                                                                                                                                                                                         |
| `nodes[].document.summary`        | map of string or number or boolean | Yes      | Kind-specific one-line facts. A timeline reports duration\_in\_frames, duration\_in\_seconds, fps, composition\_width, composition\_height, track\_count, item\_count and asset\_count.                                                                                                   |
| `edges`                           | array of objects                   | Yes      | Complete canvas edge list                                                                                                                                                                                                                                                                 |
| `edges[].from`                    | string                             | Yes      | Short identifier of the source node. At least 1 character. Example: `n1`.                                                                                                                                                                                                                 |
| `edges[].to`                      | string                             | Yes      | Short identifier of the target node. At least 1 character. Example: `n2`.                                                                                                                                                                                                                 |
| `edges[].in`                      | string or null                     | Yes      | Input slot the edge lands in on the target node, for example "image" or "enabled". Null when the edge names no slot.                                                                                                                                                                      |

## Errors

Every error has the same body: `error.code`, `error.message`, and `error.fields` on validation errors. See [Errors](https://docs.flora.ai/api/platform/errors.md) for how to recover from each code.

| Status | Code                                         | Meaning                                                                             |
| ------ | -------------------------------------------- | ----------------------------------------------------------------------------------- |
| 400    | `invalid_json`, `input_validation_error`     | The body isn't valid JSON, or an input failed validation (`fields` lists each one). |
| 401    | `unauthorized`, `invalid_api_key`            | The API key is missing, invalid or revoked.                                         |
| 402    | `insufficient_credits`                       | The workspace balance is too low for this request.                                  |
| 403    | `forbidden`, `paid_plan_required`            | The key can't do this, or the workspace plan doesn't include it.                    |
| 404    | `not_found`                                  | The resource doesn't exist or isn't visible to this key.                            |
| 409    | `idempotency_duplicate`, `revision_conflict` | Duplicate `Idempotency-Key` or a stale `base_revision`.                             |
| 429    | `rate_limited`                               | Too many requests. Back off and retry.                                              |
| 500    | `unknown_error`, `internal_error`            | Something failed on FLORA's side. Retry with backoff.                               |
| 503    | `temporarily_unavailable`                    | Authorization is temporarily unavailable. Retry later.                              |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.flora.ai/api/reference/canvas/getprojectgraph.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
