Update styling
/v1/datasets/{datasetId}/stylingReplaces 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.
Path parameters
1The dataset's id, as returned when it was created.
Request body
application/jsonrequiredA store's styling settings, as the dataset's Styling tab edits them.
Ids of the rules switched off. Every other rule is on.
printLeadspalettesetsmaterialsoccasiontuckAsShownplainBackgroundHouse basics, at most 8.
The store's own rules for choosing pieces, one per line. At most 1,200 characters.
The store's own rules for how looks are drawn, one per line. At most 1,200 characters.
Whether shoppers may see a look on their own photo (userPhotoUrl on POST /v2/agent/looks). Left out of an update, it is on.
How the stylist finds a shopper's size in this store.
Sizes they wear at other brands.
Response
A store's styling settings, as the dataset's Styling tab edits them.
Ids of the rules switched off. Every other rule is on.
printLeadspalettesetsmaterialsoccasiontuckAsShownplainBackgroundHouse basics, at most 8.
The store's own rules for choosing pieces, one per line. At most 1,200 characters.
The store's own rules for how looks are drawn, one per line. At most 1,200 characters.
Whether shoppers may see a look on their own photo (userPhotoUrl on POST /v2/agent/looks). Left out of an update, it is on.
Errors
28Every error is JSON with a single error string unless noted. Match on the status code; the message is for humans.
Request body must be valid JSON.The body is not parseable JSON.
Request body must be a JSON object.The body is empty, an array, or a JSON primitive.
Dataset not found.No dataset with this datasetId belongs to the key's organization.
styling must be an object.Neither styling nor sizing is sent, or styling is an array or not an object.
sizing must be an object.sizing is an array or not an object.
sizing.brandSizes.excludedBrands must be an array of brand slugs.excludedBrands is sent and is not an array.
At most 40 brands can be left out.excludedBrands holds more than 40 known brands.
"<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.
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"
]
}
}
}'{
"styling": {
"off": [],
"basics": [
{
"text": "Dark-wash straight-leg jeans",
"slot": "bottom"
},
{
"text": "Brown leather cowboy boots",
"slot": "footwear"
}
],
"choosing": "",
"picture": "Always cowboy boots."
}
}