Skip to main content

Widget create

Endpoint POST /widgets

Create a new widget.

Body Parameters

  • type - The type of the widget (bracket, comparison_table, chart, etc.)
  • name - The name of the widget
  • status - The status of the widget (draft or published)
  • data - The widget's data. The structure of this data will depend on the widget type. You can explore the different schemas with the Widget Data Explorer Tool tool. If not provided, a default data will be used.
  • description - The description of the widget
  • projectId - The related project ID of the widget
  • modelVersion - The version of the widget's data model. This is used to determine the schema of the data field. If not provided, the latest version will be used.

Example Request:

curl -X POST -H "Authorization: Bearer ACCESS_TOKEN" -H "Content-Type: application/json" -d '{ "name": "New Widget", "type": "bracket", "data": {} }' ""

Example Response:

"id": "894f5aed-29f5-46c5-9f26-022bfccc5292",
"name": "New Widget",
"description": "",
"type": "comparison_table",
"previewImage": "",
"projectId": "",
"status": "draft",
"modelVersion": 1,
"created": "2023-04-25T09:44:42.842Z",
"updated": "2023-04-25T09:44:42.842Z",
"data": {},
"embedCode": {
"html": "<div class=\"commonninja_component pid-894f5aed-29f5-46c5-9f26-022bfccc5292\"></div>",
"script": "<script src=\"\" defer></script>"
"editorUrl": ""