Create dataset
/v1/datasetsCreates an empty dataset in draft status and returns its id. A dataset is
the container everything else hangs off: items are uploaded into it, data
sources fill it, and search and chat run against it once it is active.
Required configuration
config must carry all six store fields — storeUrl, storeId,
storeDomain, storeName, currency and countryCode. Each is validated
in the order the keys appear in your JSON, then the six required keys are
checked for presence. Any key outside the allowed set is rejected.
Good to know
- The new dataset is
draft. Call Activate dataset once it holds items to make it visible to search, chat and the widget. nameis trimmed before it is stored.descriptiondefaults to an empty string.storeUrlmay be sent with or without a scheme (example.comorhttps://example.com); it is stored exactly as sent.currencyandcountryCodeare validated case-insensitively but stored exactly as sent, so send them in upper case (USD,US).countryCodeis validated on create but is not persisted on the dataset and does not appear in later reads.- The response is
200with just thedatasetId; it does not echo the record. Follow up with Retrieve dataset if you need it.
Request body
application/jsonrequiredDisplay name. Must be non-empty after trimming.
Free-text description.
Whether newly processed items go live automatically. Anything other than an explicit false is treated as true.
Store details. All six of storeUrl, storeId, storeDomain, storeName, currency and countryCode are required; targetGender is optional. No other keys are accepted.
The storefront URL, with or without a scheme. Must have a hostname containing a dot; localhost is rejected.
Your identifier for the store. Non-empty.
Bare domain of the store, for example shop.example.com.
Display name of the store. Non-empty.
Three-letter ISO 4217 code. Send it in upper case; it is stored exactly as sent.
Two-letter ISO 3166-1 alpha-2 code. Required and validated, but not stored on the dataset.
Force every item in this dataset to one gender. Omit or send null to keep per-item detection.
menswomensResponse
Id of the new dataset. Use it as the datasetId path parameter everywhere else.
Errors
37Every 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. Please check the organizationId.The organization that owns the key no longer exists. Checked after the body is validated.
Dataset name is required.name is missing, not a string, or blank after trimming.
config must be an object.config is null, an array or a primitive.
Unrecognized key "<key>" in config.config contains a key other than storeUrl, storeId, storeDomain, storeName, currency, countryCode or targetGender.
Store URL is required.config.storeUrl is present but empty or not a string.
Invalid hostname. Please provide a valid domain nameconfig.storeUrl has no hostname or points at localhost.
Invalid domain. Please provide a complete domain (e.g., example.com)config.storeUrl's hostname has no dot (for example a bare word).
Invalid URL format. Please provide a valid URL (e.g., example.com or https://example.com)config.storeUrl cannot be parsed as a URL even after https:// is prepended.
Store ID is required.config.storeId is present but empty or not a string.
Store domain is required.config.storeDomain is present but empty or not a string.
Store domain must be a valid domain (e.g., stylor.com or shop.example.com)config.storeDomain is not a bare domain — no scheme, no path, and a TLD of at least two letters.
Store name is required.config.storeName is present but empty or not a string.
Currency is required.config.currency is present but empty or not a string.
Currency must be a valid 3-letter ISO currency code (e.g., USD, CAD, EUR)config.currency is not three letters.
Country code is required.config.countryCode is present but empty or not a string.
Country code must be a valid 2-letter ISO country code (e.g., US, CA, GB)config.countryCode is not two letters.
Target gender must be 'mens', 'womens', or null.config.targetGender is set to anything other than mens, womens or null.
Missing key "<key>" in config.One of the six required config keys is absent. They are checked in the order storeUrl, storeId, storeDomain, storeName, currency, countryCode and the first missing one is reported.
curl -X POST "https://stylor.ai/api/v1/datasets" \
-H "Authorization: Bearer $STYLOR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Spring 2026",
"description": "Women'\''s spring drop",
"config": {
"storeUrl": "https://example-boutique.com",
"storeId": "58712345678",
"storeDomain": "example-boutique.com",
"storeName": "Example Boutique",
"currency": "USD",
"countryCode": "US",
"targetGender": "womens"
}
}'{
"datasetId": "c9b3c6c0-9b0f-4f42-bf3f-2b7a6b1b9d31"
}