Skip to content

Get a node's document

GET
/workspaces/{workspaceId}/projects/{projectId}/nodes/{nodeId}/document
import { FloraClient } from '@flora-ai/flora';
const client = new FloraClient({ apiKey: process.env['FLORA_API_KEY'] });
const canva = await client.projects.canvas.getNodeDocument({
workspaceId: '<workspaceId>',
projectId: '<projectId>',
nodeId: '<nodeId>',
});
console.log(canva);

Returns the full authored content of a document-bearing node — a timeline’s tracks, items and assets or a deck’s slides and layers — together with its revision. The project graph endpoint carries only a summary because documents can reach a megabyte. Edit by reading the document, changing it, and sending the whole document back in a canvas changeset update with base_revision set to the revision read here. A node that carries no document (an image, a text node) is rejected; a timeline that has no document yet returns not_found with the write path in the message.

Error responses use the standard error body.

workspaceId
required

Workspace identifier

string
/^ws_\S+$/

Workspace identifier

projectId
required

Project identifier

string
/^prj_\S+$/

Project identifier

nodeId
required

The node’s short id or UUID, as the project graph endpoint reports them

string
>= 1 characters

The node’s short id or UUID, as the project graph endpoint reports them

Node document returned.

Media type application/json
object
project_id
required

Project identifier

string
/^prj_\S+$/
id
required

Short node identifier

string
>= 1 characters
node_id
required

Canvas node UUID

string
>= 1 characters
type
required

Node type in agent vocabulary

string
>= 1 characters
revision
required

Current document revision; pass as base_revision on a changeset update. Always 0 for a notes node: its body is plain canvas state rather than a revisioned draft, so base_revision does not apply to it.

integer
updated_at

Last document write, Unix milliseconds. Absent for Deck documents; 0 for a notes node, which keeps none.

integer
document
required
Any of:
object
kind
required
Allowed value: timeline
schema_version
required

Document schema version; currently 1

integer
>= 1 <= 1
fps
required

Frames per second of the composition

number
composition_width
required

Even number of pixels

integer
composition_height
required

Even number of pixels

integer
tracks
required

Lanes, first is the bottom-most

Array<object>
>= 1 items <= 100 items
object
id
required

Caller-chosen identifier; survives verbatim and is how other fields refer to it

string
>= 1 characters <= 200 characters
name

Display name of the lane

string
<= 200 characters
items
required

Item ids in this lane, bottom to top of the z-order. Every id must exist in items.

Array<string>
hidden
required
boolean
muted
required
boolean
items
required

Clips keyed by item id. At least one item is required.

object
key
additional properties
Any of:
object
id
required

Caller-chosen identifier; survives verbatim and is how other fields refer to it

string
>= 1 characters <= 200 characters
from
required

Start frame on the composition timeline. Frames, not seconds.

integer
duration_in_frames
required

Length in frames. The cut is never guessed from the media.

integer
top
required

Top edge in composition pixels

number
left
required

Left edge in composition pixels

number
width
required

Width in composition pixels

number
height
required

Height in composition pixels

number
opacity
required
number
<= 1
type
required
Allowed value: video
asset_id
required

Key of a video asset in assets

string
>= 1 characters <= 200 characters
video_start_from_in_seconds
required

Offset into the source video where playback starts. Seconds.

number
decibel_adjustment
required

Gain in dB; 0 leaves the source as is

number
playback_rate
required

Speed multiplier; 1 is real time

number
audio_fade_in_duration_in_seconds
required
number
audio_fade_out_duration_in_seconds
required
number
fade_in_duration_in_seconds
required

Visual fade-in length in seconds

number
fade_out_duration_in_seconds
required

Visual fade-out length in seconds

number
crop_left
required

Fraction of the item cropped from the left

number
<= 1
crop_top
required

Fraction of the item cropped from the top

number
<= 1
crop_right
required

Fraction of the item cropped from the right

number
<= 1
crop_bottom
required

Fraction of the item cropped from the bottom

number
<= 1
border_radius
required

Corner radius in composition pixels

number
rotation
required

Rotation in degrees

number
keep_aspect_ratio
required
boolean
assets
required

Media keyed by asset id. Every media item’s asset_id must be a key here.

object
key
additional properties
Any of:
object
id
required

Caller-chosen identifier; survives verbatim and is how other fields refer to it

string
>= 1 characters <= 200 characters
filename
required

Display name in the editor. Defaults to the last path segment of media_url.

string
>= 1 characters
mime_type
required

Defaults from the asset type and the media_url extension.

string
>= 1 characters
source_node_id

Canvas node whose output seeded this asset, when known. Read-only.

string
type
required
Allowed value: video
media_url
required

Durable https URL of the media the renderer fetches. Flora’s own asset URLs and any public https URL are accepted.

string format: uri
width
required

Native media width in pixels

number
height
required

Native media height in pixels

number
duration_in_seconds
required
number
has_audio_track
required
boolean
Example
{
"project_id": "prj_abc123",
"id": "n7",
"node_id": "7f6ae6da-4a0e-4a2f-9c6a-2c1c6b8d1f21",
"type": "timeline",
"document": {
"kind": "timeline",
"items": {
"additionalProperty": {
"type": "video"
}
},
"assets": {
"additionalProperty": {
"type": "video"
}
}
}
}