Create Widget Style
Creates a styling preset for the current node. The returned id is what you pass to the widget as widgetStyleId.
Authentication: Bearer token required.
Endpoint: POST /api/v2/widget-styles
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
| name | string | Yes | min 1, max 255. Unique per node |
| primary_color | string | Yes | max 32. CSS color (#3b82f6, rgb(...)) |
| secondary_color | string | Yes | max 32 |
| background_color | string | Yes | max 32 |
| surface_color | string | Yes | max 32 |
| text_color | string | Yes | max 32 |
| muted_text_color | string | Yes | max 32 |
| border_color | string | Yes | max 32 |
| font_family | string | Yes | max 255. CSS font-family value |
| font_size_base | int | Yes | px. min 8, max 32 |
| font_size_heading | int | Yes | px. min 10, max 64 |
| font_weight_heading | int | Yes | min 100, max 900 |
| border_radius | int | No | px. min 0, max 64. Default 0 |
| custom_css | string | No | max 32768. Raw CSS appended after generated variables — last write wins |
Response — 201 Created
Returns the created WidgetStyleResponse (same shape as Get Widget Style).
| Status | Description |
|---|---|
| 400 | Validation error |
| 401 | Unauthorized |
| 409 | A style with this name already exists for the node |