Skip to main content
POST

Authorizations

Authorization
string
header
required

Send your API key as a bearer token: Authorization: Bearer <your API key>. Make a key in the dashboard under Settings → API keys; a workspace key starts with wdg_org_ and works in the workspace it was made in. See API keys and Authentication.

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 an empty one of yours: a canvas holds one widget). 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, and it must have no widget yet: a canvas holds one widget, and one that already has a widget is refused with 409 (CANVAS_ALREADY_HAS_WIDGET).

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>

The workspace the widget belongs to. You must be a member who may create widgets there. Leave it out and the widget goes where its project is, or, when it names no project, in the workspace your key, your connection or your workspace switcher is working in. Naming a project of one workspace and the id of another is refused (400).

Example:

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

managedUserId
string<uuid>

Make the widget for one of your managed users, by Widgetic's id for the user. Partners only, with an active partner API key. 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). Partners only. 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.