Skip to main content
POST
Create Widget

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

Idempotency-Key
string
required

A unique value (a UUID is fine) that makes a retry of this request safe.

Body

application/json

What a new widget starts from. Only the fields listed here are used. The widget is created without code: it is a record with a name, a type and some starting content, on a canvas (a new one, unless you name one of yours). It has no database: what the visitors of a composition leave is kept in the tables of that composition.

name
string
required

Name of the widget.

Minimum string length: 1
Example:

"New Chart Widget"

type
string
required

What kind of widget this is, as a label of your choosing (for example chart, form, gallery).

Minimum string length: 1
Example:

"chart"

content
object
required

Starting content for the widget. An empty object is fine.

Example:
isPublic
boolean
default:false

Whether the widget is public.

Example:

false

isDraft
boolean
default:true

Whether the widget starts as a draft. A widget created without this is a draft.

Example:

false

canvasId
string<uuid>

Put the widget on this existing canvas instead of a new one. You must own the canvas.

Example:

"abc12345-def6-7890-ab12-cd3456ef7890"

projectId
string<uuid>

Project to file the widget in. You must be able to edit the project.

Example:

"7c1e2f30-4a5b-4c6d-8e9f-0a1b2c3d4e5f"

organizationId
string<uuid>

Organization the widget belongs to. You must be a member who may create widgets there.

Example:

"5e2d3f4a-1b6c-4a1f-8b9c-3c2d4e5f6a7b"

workspaceType
enum<string>

Whether the widget lives in your personal workspace or in an organization's.

Available options:
personal,
organization
Example:

"personal"

managedUserId
string<uuid>

Make the widget for one of your managed users, by Widgetic's id for the user. Send this or managedUserExternalId, not both. The managed user must be yours and active. The widget stays in your account; the tag lets you list one user's widgets and keeps it out of the others' lists. It is set here and does not change afterwards.

Example:

"b7c8d9e0-1f2a-4b3c-8d4e-5f6a7b8c9d0e"

managedUserExternalId
string

The same, by your own identifier for the user, the externalId you gave when you created the managed user (answers show it as externalId). Send this or managedUserId, not both.

Maximum string length: 255
Example:

"user-8841"

Response

Widget created successfully

success
boolean
required
data
object
required

Represents a widget in the system.

Example:
meta
object

Extra information about the answer: where a page sits in a list, the cursor of the next page, or warnings about a call that succeeded with a caveat.