Get a project graph
import { FloraClient } from '@flora-ai/flora';
const client = new FloraClient({ apiKey: process.env['FLORA_API_KEY'] });
const canva = await client.projects.canvas.getGraph({ workspaceId: '<workspaceId>', projectId: '<projectId>',});console.log(canva);curl -X GET 'https://app.flora.ai/api/v1/workspaces/<workspaceId>/projects/<projectId>/graph' \ -H 'Authorization: Bearer $FLORA_API_KEY'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.
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
Project identifier
Project identifier
Responses
Section titled “ Responses ”Project graph returned.
object
Project identifier
Project canvas URL
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.
Complete canvas node list
object
Short node identifier. Stable across reads and the vocabulary canvas edges use.
Canvas node UUID. Stable for the node’s life.
Node type in agent vocabulary, for example image, video, text, model3d, action, batch, or group
Node display label
Absolute canvas position with parent groups resolved
object
Horizontal canvas coordinate
Vertical canvas coordinate
Machine-readable failure code. Present only when status is error.
User-facing failure message. Present only when status is error.
object
Document kind, for example “timeline”. Kinds you do not recognise may appear on newer nodes: keep the wrapper and ignore the body.
Version of the document schema the body follows
Revision of this node’s document. Pass it as base_revision on a changeset update to reject a stale write.
Last document write, Unix milliseconds; absent for Deck documents
Example
{ "project_id": "prj_abc123", "revision": "4f2c8ab19e3d7c05", "nodes": [ { "id": "n1", "node_id": "7f6ae6da-4a0e-4a2f-9c6a-2c1c6b8d1f21", "type": "image", "status": "idle" } ], "edges": [ { "from": "n1", "to": "n2" } ]}