Update a widget theme

patch/v1/widget/presets/{presetId}

Changes some of a theme's fields. Only the fields in fields are written, so sending one colour changes that colour and nothing else. A storefront using this theme shows the change on its next page load.

Changing buttonLabel redoes the label's automatic translations; translations you wrote (edited: true) are kept. Sending buttonLabelTranslations replaces the stored set with yours, and any language your stores use that it leaves out is translated again.

Needs the widget:write scope. Fields are checked all at once: nothing is saved if any is wrong. Unknown keys in fields are ignored.

Private keyapi.v1.widget.presets.updateNo demo

Path parameters

1
presetIdstring (uuid)required

The theme's id.

Request body

application/jsonrequired
fieldsobjectrequired

Any of the fields POST /v1/widget/presets takes (name, buttonLabel, buttonLabelTranslations, the colours, roundness), at least one, with the same rules. A field sent as null counts as not sent.

Response

200The theme as saved.
WidgetPresetrequired

A saved widget theme, as stored.

idstring (uuid)required

Pass it to the embed, or to preflight, as themeId.

namestringrequired

Shown in the theme builder.

objectrequired

The colours, grouped as stored.

createdstring (date-time)required

When it was saved first.

modifiedstring (date-time)required

When it was last changed.

Errors

31

Every error is JSON with a single error string unless noted. Match on the status code; the message is for humans.

400
Request body must be valid JSON.

The body is not parseable JSON.

400
Request body must be a JSON object.

The body is empty, an array, or a JSON primitive.

404
Widget preset not found: <presetId>

No theme with this id belongs to the key's organization. Checked after the fields.

422
Nothing to update.

fields is missing, not an object, or holds none of the theme's fields.

422
Validation failed.

More than one field is invalid. details names each one.

{
  "error": "Validation failed.",
  "details": [
    {
      "path": "accentColor",
      "message": "Accent colour must be a hex colour, like #FFFFFF or #FFF."
    },
    {
      "path": "roundness",
      "message": "roundness must be a whole number from 0 to 100."
    }
  ]
}
422
Accent colour must be a hex colour, like #FFFFFF or #FFF.

One field is invalid. The message is that field's own, the same ones POST /v1/widget/presets lists (except <field> is required., which an update never returns).

curl -X PATCH "https://stylor.ai/api/v1/widget/presets/YOUR_PRESET_ID" \
  -H "Authorization: Bearer $STYLOR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "fields": {
    "accentColor": "#7A3E12"
  }
}'
Response · 200
{
  "preset": {
    "id": "7e6d5c4b-3a2f-4e1d-9c8b-7a6f5e4d3c2b",
    "name": "Ranch",
    "options": {
      "button": {
        "label": "Ask a stylist",
        "color": "#2D2926",
        "hoverColor": "#000000",
        "textColor": "#FFFFFF"
      },
      "widget": {
        "typingDotColor": "#999999",
        "accentColor": "#B5651D",
        "accentHoverColor": "#8A4B12",
        "mutedTextColor": "#6B6B6B",
        "primaryTextColor": "#2D2926",
        "pageColor": "#FBF8F3",
        "surfaceColor": "#FFFFFF",
        "borderColor": "#E6E1DA",
        "inputColor": "#F3EFE9",
        "footerColor": "#FBF8F3",
        "roundness": 60
      }
    },
    "created": "2026-10-04T18:20:03.001Z",
    "modified": "2026-10-04T18:20:03.001Z"
  }
}