Update styling

put/v1/datasets/{datasetId}/styling

Replaces the dataset's styling settings, its sizing settings, or both: send styling, sizing or the two. Each one sent is replaced whole, as GET /v1/datasets/{datasetId}/styling returns it: a field left out is saved empty, except tryOn, brandSizes.enabled and brandSizes.logos, which are on unless sent as false. New looks and chats follow the change at once.

Unknown brand slugs in excludedBrands are dropped; more than 40 known ones is refused.

Text is shortened rather than refused: a house basic to one line of 80 characters, and each of choosing and picture to 1,200. Unknown rule ids in off and repeated basics are dropped.

Private keyapi.v1.datasets.styling.updateNo demo

Path parameters

1
datasetIdstring (uuid)required

The dataset's id, as returned when it was created.

Request body

application/jsonrequired
DatasetStyling

A store's styling settings, as the dataset's Styling tab edits them.

offarray<string>required

Ids of the rules switched off. Every other rule is on.

One ofprintLeadspalettesetsmaterialsoccasiontuckAsShownplainBackground
array<object>required

House basics, at most 8.

maxItems: 8
choosingstringrequired

The store's own rules for choosing pieces, one per line. At most 1,200 characters.

maxLength: 1200
picturestringrequired

The store's own rules for how looks are drawn, one per line. At most 1,200 characters.

maxLength: 1200
tryOnboolean

Whether shoppers may see a look on their own photo (userPhotoUrl on POST /v2/agent/looks). Left out of an update, it is on.

default: true
DatasetSizing

How the stylist finds a shopper's size in this store.

object

Sizes they wear at other brands.

Response

200The settings as saved.
DatasetStylingrequired

A store's styling settings, as the dataset's Styling tab edits them.

offarray<string>required

Ids of the rules switched off. Every other rule is on.

One ofprintLeadspalettesetsmaterialsoccasiontuckAsShownplainBackground
array<object>required

House basics, at most 8.

maxItems: 8
choosingstringrequired

The store's own rules for choosing pieces, one per line. At most 1,200 characters.

maxLength: 1200
picturestringrequired

The store's own rules for how looks are drawn, one per line. At most 1,200 characters.

maxLength: 1200
tryOnboolean

Whether shoppers may see a look on their own photo (userPhotoUrl on POST /v2/agent/looks). Left out of an update, it is on.

default: true

Errors

28

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
Dataset not found.

No dataset with this datasetId belongs to the key's organization.

422
styling must be an object.

Neither styling nor sizing is sent, or styling is an array or not an object.

422
sizing must be an object.

sizing is an array or not an object.

422
sizing.brandSizes.excludedBrands must be an array of brand slugs.

excludedBrands is sent and is not an array.

422
At most 40 brands can be left out.

excludedBrands holds more than 40 known brands.

422
"<text>" needs a slot: one of top, bottom, footwear, outerwear, headwear, accessory.

A house basic has text but no slot, or a slot that is not one of these.

422
At most 8 house basics.

basics holds more than 8 pieces after empty ones and repeats are dropped.

curl -X PUT "https://stylor.ai/api/v1/datasets/YOUR_DATASET_ID/styling" \
  -H "Authorization: Bearer $STYLOR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "sizing": {
    "brandSizes": {
      "enabled": true,
      "logos": false,
      "excludedBrands": [
        "zara",
        "boohoo"
      ]
    }
  }
}'
Response · 200
{
  "styling": {
    "off": [],
    "basics": [
      {
        "text": "Dark-wash straight-leg jeans",
        "slot": "bottom"
      },
      {
        "text": "Brown leather cowboy boots",
        "slot": "footwear"
      }
    ],
    "choosing": "",
    "picture": "Always cowboy boots."
  }
}