跳转到内容
EN

创建画布

POST /canvas/v1/canvases

Create a blank design canvas in the API key’s organization before drawing with praxis.canvas.canvases.execute. Send an optional name of at most 200 characters; omitting name uses Untitled. Each successful call creates a new canvas and returns its id and viewer_url with HTTP 201; save the id for subsequent reads, edits and deletion.

支持状态: supported

请求体 (application/json)

必填: false

名称类型说明
namestringDisplay name for the new canvas, at most 200 characters; omission uses Untitled.
{
"type": "object",
"properties": {
"name": {
"type": "string",
"maxLength": 200,
"default": "Untitled",
"description": "Display name for the new canvas, at most 200 characters; omission uses Untitled."
}
}
}

响应

HTTP 201

The newly created canvas; use id for API calls and viewer_url to watch it in Console.

application/json

名称 类型 说明
id string Assigned canvas identifier, cvs_ followed by 16 lowercase letters or digits; reuse it as canvas_id in subsequent requests.
object string Resource discriminator; canvas identifies a design canvas.
name string Display name supplied at creation; defaults to Untitled if omitted and is not an API identifier.
version string Current revision as a decimal string, incremented by one after each successful write; pass it as expected_version to guard a subsequent execute call.
page_count integer Number of visible top-level frames in this canvas; hidden frames do not contribute.
node_count integer Total number of design nodes currently in the canvas.
created_at string ISO 8601 timestamp recording when this canvas was created.
updated_at string ISO 8601 timestamp of the latest canvas update; list orders canvases newest first by this value.
viewer_url string Console URL where a person can watch this canvas update live; open it to review drawing results.
collection_id string | null Collection id from collections.list, or null for an uncategorized canvas; a canvas belongs to at most one collection.
library null | object The canvas's latest published library version, or null when it has never been published as a library.
library.version string Latest published library version, counting from 1.
library.published_at string ISO 8601 time at which that version was published.
imports array<object> Libraries this canvas imports, by alias; present on retrieve and list, absent where only the canvas is named (create, update).
imports[].alias string The alias this library is imported under; components are referenced as alias:component_id and variables as $alias:name.
imports[].library string The library's canvas id.
imports[].name string The library's current name, or the name it had when imported if the library canvas was deleted.
imports[].version string The library version this canvas uses.
imports[].latest_version string | null The library's newest published version, or null when the library canvas was deleted.
imports[].status string current means this canvas uses the newest version; outdated means a newer one exists (move the alias with imports.create); deleted means the library canvas is gone, and the imported version keeps rendering.
imports[].instances object Present on retrieve only. How many nodes of this canvas instantiate each component, keyed by component id without the alias, including instances inside replaced subtrees; a component with no instance is absent.