Create widget

View as Markdown

Validates the SQL, registers the filter tokens it declares, and places the widget on tab_id or the board’s first tab.

Path parameters

org_idstringRequired
Organization ID
workspace_idstringRequired
Workspace ID
board_idstringRequiredformat: "uuid"

Headers

X-API-KeystringRequired
Your workspace API key.

Request

This endpoint expects an object.
namestringRequired1-60 characters
Widget display name
sqlstringRequired>=1 character

Read-only SELECT against the workspace’s analytics views. Filter tokens use {{name}} for a required value and [[AND col = {{name}}]] for a clause that is dropped when the value is absent. Tenant scoping is enforced server-side.

viz_typeenumOptionalDefaults to table
How the result is rendered
viz_configobjectOptional

Renderer options for viz_type

filterslist of objectsOptional

Declarations for the filter tokens used in sql

tab_idstring or nullOptionalformat: "uuid"
Target tab. Defaults to the board's first tab when absent.

Response

Successful Response
idstringformat: "uuid"
Widget identifier
board_idstringformat: "uuid"
Board this widget belongs to
namestring
Widget display name
sqlstring
The widget's stored SQL, filter tokens unexpanded
viz_typestring
How the result is rendered
viz_configobject

Renderer options for viz_type

created_byobject
Actor that created the widget
created_atdatetime
Creation time, UTC, RFC 3339
updated_byobject
Actor that last changed the widget
updated_atdatetime
Last change time, UTC, RFC 3339

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
404
Not Found Error
422
Unprocessable Entity Error
429
Too Many Requests Error
500
Internal Server Error