Update dataset
/v1/datasets/{datasetId}Updates a dataset's name, description, metadata, status or store
configuration. Send the changes inside a fields object; only the keys
you include are touched.
Accepted fields
| Field | Rule |
|---|---|
name |
Non-empty string. Trimmed, internal whitespace collapsed, cut to 200 characters. |
description |
Any string (empty allowed). Whitespace collapsed, cut to 2000 characters. |
metadata |
A plain JSON object. Replaces the whole metadata value; it is not merged. |
status |
active, draft or archived. |
config.storeDomain |
Bare domain, no scheme, path or query. |
config.storeUrl |
http(s):// URL with a host — unlike create, the scheme is required here. |
config.storeName |
Non-empty string, cut to 200 characters. |
config.storeId |
Non-empty string, cut to 200 characters. |
config.targetGender |
mens, womens or null. |
Config fields can be sent nested ("config": { "storeUrl": … }) or as
dot-path keys ("config.storeUrl": …).
Validation is all-or-nothing
Every field you send is checked before anything is written. If any field
is invalid, or is not in the list above, nothing is changed and the
response is 422 with a details array naming each failing field.
details[].path |
details[].message |
|---|---|
fields |
No valid fields to update. Allowed fields: name, description, metadata, status, config.storeDomain, config.storeUrl, config.storeName, config.storeId, config.targetGender. (sent when fields is omitted or empty) |
<key> or config.<key> |
Unsupported field: <key> |
config |
config must be an object. |
name |
name must be a non-empty string. |
description |
description must be a string. |
config.storeDomain |
config.storeDomain must be a valid domain excluding any path, query parameters, or HTTP method. |
config.storeUrl |
config.storeUrl must be a valid http(s) URL. |
config.storeName |
config.storeName must be a non-empty string. |
config.storeId |
config.storeId must be a non-empty string. |
config.targetGender |
config.targetGender must be 'mens', 'womens', or null. |
status |
status must be 'active', 'draft', or 'archived'. |
metadata |
metadata must be a plain object. |
Good to know
- Changing
statushere only flips the flag. Use Activate dataset and Archive dataset when you also want items, queue rows and data sources to follow, which is almost always. - Changing
config.targetGenderdoes not rewrite the gender already stored on existing items; only items ingested afterwards pick it up. - The response
datasetis the full stored record, includingorganizationIdandautoPublish, unlike Retrieve dataset.
Path parameters
1The dataset to update.
Request body
application/jsonrequiredThe fields to change. Config values can be nested under config or
sent as dot-path keys (config.storeUrl). Unrecognised keys are
rejected with 422 and nothing is written.
New display name. Non-empty; whitespace collapsed; cut to 200 characters.
New description. Empty string allowed; whitespace collapsed; cut to 2000 characters.
Replaces the whole metadata object. Must be a plain object, not an array.
Lifecycle state of a dataset.
- draft — newly created; not visible to search, chat or the widget.
- active — live. Any number of datasets can be active at once.
- archived — parked. Data is kept, items and sources are switched off.
draftactivearchivedPartial store configuration. Only the keys you send are changed.
Response
The full stored dataset record. Returned by *Update dataset*, *Activate
dataset* and *Archive dataset*. List and retrieve responses project a
subset — see DatasetSummary and DatasetDetail.
Internal _id and __v fields are stripped by *Update dataset* but are
still present on the activate and archive responses; ignore them.
Unique id of the dataset. Use it as the datasetId path parameter.
Id of the organization that owns the dataset — the one behind your API key.
Lifecycle state of a dataset.
- draft — newly created; not visible to search, chat or the widget.
- active — live. Any number of datasets can be active at once.
- archived — parked. Data is kept, items and sources are switched off.
draftactivearchivedDisplay name. Trimmed on create; cut to 200 characters on update.
Free-text description. Defaults to an empty string; cut to 2000 characters on update.
Arbitrary JSON you attach to the dataset. Omitted when never set. Replaced wholesale by *Update dataset*.
Store details attached to a dataset. Set on create, editable field-by-field on update.
Whether newly processed items go live automatically. Set on create; true unless explicitly false.
When the dataset was created.
When the dataset record was last written.
Errors
25Every 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 request body could not be parsed as JSON.
Request body must be a JSON object.The body is empty, or is valid JSON but not an object (for example an array, a string or null).
Organization not found for the provided organizationId.The organization that owns the key no longer exists.
Dataset not found for this organization.No dataset with that id belongs to your organization.
Update failed: dataset document not found or no changes applied.The dataset disappeared between the ownership check and the write.
datasetId is required.datasetId is empty or blank.
fields must be an object.fields is null, an array, or a primitive.
Validation failed.One or more fields failed validation, or fields was omitted or empty. Nothing was written. details has one { path, message } entry per failing field; the possible messages are listed in the description. The organization and dataset are checked first, so a 401 or 404 takes precedence.
{
"error": "Validation failed.",
"details": [
{
"path": "config.storeUrl",
"message": "config.storeUrl must be a valid http(s) URL."
},
{
"path": "colour",
"message": "Unsupported field: colour"
}
]
}curl -X PATCH "https://stylor.ai/api/v1/datasets/YOUR_DATASET_ID" \
-H "Authorization: Bearer $STYLOR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"fields": {
"name": "Spring 2026 — final",
"metadata": {
"owner": "merchandising"
}
}
}'{
"dataset": {
"datasetId": "c9b3c6c0-9b0f-4f42-bf3f-2b7a6b1b9d31",
"organizationId": "0a2c1f4e-5b6d-7e8f-9012-3456789abcde",
"status": "active",
"name": "Spring 2026 — final",
"description": "Women's spring drop",
"metadata": {
"owner": "merchandising"
},
"config": {
"storeUrl": "https://example-boutique.com",
"storeId": "58712345678",
"storeDomain": "example-boutique.com",
"storeName": "Example Boutique",
"currency": "USD",
"targetGender": "womens"
},
"autoPublish": true,
"createdAt": "2026-03-02T09:14:31.208Z",
"updatedAt": "2026-09-12T10:02:44.130Z"
}
}