Skip to main content
Canvases are the editing environment where a widget is designed and configured. Each canvas represents an editing session with its own state, and it holds one widget.

Overview

With the Canvases API, you can:
  • Create new canvases
  • List existing canvases
  • Retrieve canvas details
  • Update canvas content
  • Delete canvases

List Canvases

Retrieve all canvases with pagination and filtering:
The canvases are in data.data of the answer, next to page, size and total.

Filtering Canvases

Filter canvases by various criteria:
You can also filter by updatedBefore. The list cannot be filtered by persistence key.

Get Canvas by ID

Retrieve a specific canvas:

Create Canvas

Create a new canvas:

One Widget to a Canvas

A canvas holds one widget at a time. A new canvas is empty. Its widget is made with POST /widgets, naming the canvas in canvasId; a widget made without a canvas gets a canvas of its own. Naming a canvas that already has a widget is refused with 409 and the code CANVAS_ALREADY_HAS_WIDGET, and nothing is created (see Where a Widget Can Go). primaryWidgetId on the canvas is the widget it holds, or null while it has none.

Update Canvas

Update an existing canvas:

Delete Canvas

Delete a canvas. Its widget is deleted with it:

Canvas Structure

A canvas in an answer carries these fields: An answer can carry other fields. They are for Widgetic’s own apps and can change without notice, so read only the ones above.

Canvas Content

The canvasContent field stores the canvas state. It holds JSON of your choosing: the API saves what you send and does not check its shape. The examples above use this shape:
An update replaces canvasContent as a whole, so send all of it.

Persistence Keys

Use persistence keys to maintain references between your application and Widgetic:
The list cannot be filtered by persistence key, so keep the id that creation returns in your own records.

Next Steps

Widgets

Make the widget of a canvas

Compositions

Set a widget up for one place and embed it