Get a node's document
Get a node's document with the FLORA API: GET /workspaces/{workspaceId}/projects/{projectId}/nodes/{nodeId}/document.
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.
GET https://app.flora.ai/api/v1/workspaces/{workspaceId}/projects/{projectId}/nodes/{nodeId}/documentAuth: API key as a bearer token,
Authorization: Bearer $FLORA_API_KEY. See Authentication.TypeScript SDK:
client.projects.canvas.getNodeDocument().Operation ID:
getCanvasNodeDocument.
Example
curl -X GET 'https://app.flora.ai/api/v1/workspaces/ws_abc123/projects/prj_abc123/nodes/n7/document' \
-H "Authorization: Bearer $FLORA_API_KEY"import { FloraClient } from '@flora-ai/flora';
const client = new FloraClient({ apiKey: process.env['FLORA_API_KEY'] });
const canvas = await client.projects.canvas.getNodeDocument({
workspaceId: 'ws_abc123',
projectId: 'prj_abc123',
nodeId: 'n7',
});
console.log(canvas);Path parameters
workspaceId
string
Yes
Workspace identifier. Pattern: ^ws_\S+$. Example: ws_abc123.
projectId
string
Yes
Project identifier. Pattern: ^prj_\S+$. Example: prj_abc123.
nodeId
string
Yes
The node's short id or UUID, as the project graph endpoint reports them. At least 1 character. Example: n7.
Responses
200: Node document returned.
project_id
string
Yes
Project identifier. Pattern: ^prj_\S+$. Example: prj_abc123.
id
string
Yes
Short node identifier. At least 1 character. Example: n7.
node_id
string
Yes
Canvas node UUID. At least 1 character. Example: 7f6ae6da-4a0e-4a2f-9c6a-2c1c6b8d1f21.
type
string
Yes
Node type in agent vocabulary. At least 1 character. Example: timeline.
revision
integer
Yes
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.
updated_at
integer
No
Last document write, Unix milliseconds. Absent for Deck documents; 0 for a notes node, which keeps none.
document
object
Yes
Authored content of a document-bearing node, every field concrete. See the document shapes below.
Errors
Every error has the same body: error.code, error.message, and error.fields on validation errors. See Errors for how to recover from each code.
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.
Last updated
Was this helpful?