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.
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.
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.
How the stylist finds a shopper's size in this store.
Sizes they wear at other brands.
Errors
36Every 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.
datasetId is required.datasetId is empty.
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 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.
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.
Choose at least 3 brands, or null for every brand.includedBrands holds fewer than 3 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,
"includedBrands": [
"levis",
"madewell",
"abercrombie-fitch"
]
}
}
}'{
"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
}
}
}