Export a canvas
Export a fully generated canvas as JSON: its nodes, edges, video URLs and inputs, as a MaskoAnimationConfig by default.
curl https://api.masko.ai/v1/canvases/CANVAS_ID/export \
-H "Authorization: Bearer masko_YOUR_API_KEY"Before exporting
Turn on asset hosting with Get Links in the Masko app or with POST /v1/mascots/MASCOT_ID/publish (turn on hosting), then wait for status.media.generation.ready: true on the canvas: every node image and edge video completed, not just assigned. Otherwise the export returns HTTP 400.
The MaskoAnimationConfig
A versioned JSON format (currently 2.0) describing the state machine. All media URLs use the public CDN.
Response Structure
{
"version": "2.0",
"name": "My Mascot",
"initialNode": "idle",
"autoPlay": true,
"clickEffect": "none",
"nodes": [
{
"id": "idle",
"name": "Idle",
"transparentThumbnailUrl": "https://assets.masko.ai/57fa7e3f-4fdb-556a-8167-968b2b3d8f4b/idle.png"
},
{
"id": "waving",
"name": "Waving",
"transparentThumbnailUrl": "https://assets.masko.ai/57fa7e3f-4fdb-556a-8167-968b2b3d8f4b/waving.png"
},
{
"id": "thinking",
"name": "Thinking",
"transparentThumbnailUrl": "https://assets.masko.ai/57fa7e3f-4fdb-556a-8167-968b2b3d8f4b/thinking.png"
}
],
"edges": [
{
"id": "idle-loop",
"source": "idle",
"target": "idle",
"isLoop": true,
"duration": 4,
"videos": {
"webm": "https://assets.masko.ai/57fa7e3f-4fdb-556a-8167-968b2b3d8f4b/idle-loop.webm",
"hevc": "https://assets.masko.ai/57fa7e3f-4fdb-556a-8167-968b2b3d8f4b/idle-loop.mp4"
}
},
{
"id": "idle-to-waving",
"source": "idle",
"target": "waving",
"isLoop": false,
"duration": 4,
"videos": {
"webm": "https://assets.masko.ai/57fa7e3f-4fdb-556a-8167-968b2b3d8f4b/idle-to-waving.webm",
"hevc": "https://assets.masko.ai/57fa7e3f-4fdb-556a-8167-968b2b3d8f4b/idle-to-waving.mp4"
},
"conditions": [{ "input": "behavior::interact", "op": "==", "value": true }]
},
{
"id": "waving-to-idle",
"source": "waving",
"target": "idle",
"isLoop": false,
"duration": 4,
"videos": {
"webm": "https://assets.masko.ai/57fa7e3f-4fdb-556a-8167-968b2b3d8f4b/waving-to-idle.webm",
"hevc": "https://assets.masko.ai/57fa7e3f-4fdb-556a-8167-968b2b3d8f4b/waving-to-idle.mp4"
}
}
],
"inputs": [
{
"name": "behavior::interact",
"type": "boolean",
"default": false
}
]
}Config Fields
| Field | Type | Description |
|---|---|---|
version | string | Config format version. Currently "2.0". |
name | string | Display name of the canvas. |
initialNode | string | ID of the node to display on load. |
autoPlay | boolean | Start playing the initial loop automatically. |
clickEffect | string | Optional click effect, currently "ripple" or "none". |
nodes[] | array | Mascot poses. Each has id, name, and optional transparentThumbnailUrl. |
edges[] | array | Transitions between nodes. Each has source, target, isLoop, duration, videos, and optional conditions. A node can have several isLoop edges: the first without conditions is its loop, and the others play while their conditions hold, or now and then when they have none. |
inputs[] | array | Programmatic inputs. Each has name, type, and default. |
Play it
Apps play a release, not this config: create one through /v1/canvases/CANVAS_ID/history, fetch its signed delivery through your backend and play it with the Masko player. Never pass a raw draft export or an API key to a visitor.
In the config, each edge's webm URL is for Chrome, Firefox and Edge, and its hevc (MP4) URL for Safari.
Targeted delivery
?delivery=1&target=macos returns the runtime delivery envelope under data instead of the config. target also accepts android (stacked MP4, for Android players), apple (HEVC, for iPhone, iPad and Mac players), web, windows or full, which select media formats; the desktop runtime itself runs on macOS only.
mode=selected is the default and mode=manifest requests manifest delivery. An optional positive integer size selects a variant. See the endpoint reference for the envelope fields.
