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.

includedBrands left out or null offers every brand. Unknown brand slugs in it are dropped; fewer than 3 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, basics with empty text, and repeated basics (the same text ignoring case, or the same basicId) are dropped. A basic keeps the basicId you send back when it is 8 to 64 letters, digits or hyphens; otherwise it is given a new one.

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

200Both settings as now saved, every gap filled with its default, the same shape as the retrieve response.
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
DatasetSizingrequired

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

object

Sizes they wear at other brands.

Errors

36

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
datasetId is required.

datasetId is empty.

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 must be an object.

sizing.brandSizes is sent and is not an object (for example an array or a string). null is treated as empty.

422
sizing.brandSizes.includedBrands must be an array of brand slugs, or null for every brand.

includedBrands is sent and is neither an array nor null.

422
Choose at least 3 brands, or null for every brand.

includedBrands holds fewer than 3 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,
      "includedBrands": [
        "levis",
        "madewell",
        "abercrombie-fitch"
      ]
    }
  }
}'
Response · 200
{
  "styling": {
    "off": [],
    "basics": [
      {
        "text": "Dark-wash straight-leg jeans",
        "slot": "bottom",
        "basicId": "6f1d2c9a-3b4e-4a5f-8c7d-1e2f3a4b5c6d"
      },
      {
        "text": "Brown leather cowboy boots",
        "slot": "footwear",
        "basicId": "9a8b7c6d-5e4f-4321-8765-4a3b2c1d0e9f"
      }
    ],
    "choosing": "",
    "picture": "Always cowboy boots.",
    "tryOn": true
  },
  "sizing": {
    "brandSizes": {
      "enabled": true,
      "logos": true,
      "includedBrands": null
    }
  }
}