Skip to main content

Widget update

Endpoint PUT /widgets/:id

Update a user's widget data.

Path Parameters

Required
  • id - The widget's id.

Body Parameters

  • name - The name of the widget
  • description - The description 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.
All parameters are optional

You can update only the parameters you want to change. There's no need to send all the parameters.

Example Request:

curl -X PUT -H "Authorization: Bearer ACCESS_TOKEN" -H "Content-Type: application/json" -d '{ "name": "Widget name updated!" }' "https://api.commoninja.com/platform/api/v1/widgets/894f5aed-29f5-46c5-9f26-022bfccc5292"

Example Response:

{
"id": "894f5aed-29f5-46c5-9f26-022bfccc5292",
"name": "Widget name updated!",
"description": "",
"type": "comparison_table",
"previewImage": "",
"status": "draft",
"projectId": "",
"modelVersion": 1,
"created": "2023-04-25T09:44:42.842Z",
"updated": "2023-04-25T09:44:42.842Z",
"data": {}
}