Create a data source
/v1/datasets/{datasetId}/sourcesConnects a store to a dataset. The only supported type today is
shopify-api, which reads the public storefront catalogue at
https://<store>.myshopify.com/products.json. You can pass either the full
products.json URL or the bare store origin; the sync worker appends
/products.json and pages through the catalogue 250 products at a time.
syncPeriod controls automatic syncing, in minutes. A source is due when at
least syncPeriod minutes have passed since its last successful sync (a source
that has never synced is due immediately), at which point the scheduler enqueues
a sync job for it. Pass 0 to disable automatic syncing and trigger jobs
yourself with Create sync job. Only active sources are scheduled, and only
active sources accept manual jobs.
disableGenerativeAssets is accepted but AI-generated thumbnails are currently
turned off platform-wide, so the stored value is always true.
Creating a source does not start a sync. Trigger one explicitly, or wait for the scheduler.
The response is 200, not 201.
Path parameters
1The dataset the source will feed. Must belong to your organization.
Request body
application/jsonrequiredConnector type. Only shopify-api is supported.
shopify-apiAbsolute URL of the store's public products.json endpoint, or the store
origin. Must parse as a URL.
Automatic sync interval in minutes. Must be a JSON number: 0 (never sync
automatically) or at least 60. Strings are rejected on create.
Whether the source is scheduled and accepts sync jobs.
activeinactiveAccepted for forward compatibility; currently always stored as true.
Response
Always true on a 2xx response.
A store connection that feeds a dataset. Sources carry no credentials: the Shopify connector reads the public storefront catalogue, so the only stored configuration is the endpoint URL. Nothing is redacted from responses.
Unique identifier of the source. Generated on create.
The dataset this source feeds.
The organization that owns the source.
Connector type. shopify-api reads a Shopify storefront's public products.json.
shopify-apiactive sources are picked up by the scheduler and accept manual sync jobs.
inactive sources are ignored by the scheduler and reject manual jobs.
activeinactiveScheduling state.
Connector configuration.
When the source was created.
When the source was last modified, including scheduler updates to sync.previous.
Errors
26Every 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 is not parseable JSON. This response carries no rate-limit headers.
Request body must be a JSON object.The request body is empty, an array, or a JSON scalar. This response carries no rate-limit headers.
Dataset not found or does not belong to organizationNo dataset with that datasetId belongs to the organization that owns the key. Checked after field validation.
type must be "shopify-api"type is missing or is anything other than shopify-api, and it is the only invalid field.
endpoint is required and must be a stringendpoint is missing, empty, or not a string, and it is the only invalid field.
endpoint must be a valid URLendpoint is a string that does not parse as an absolute URL, and it is the only invalid field.
syncPeriod is required and must be 0 (Never) or at least 60 minutessyncPeriod is missing, not a JSON number, or a number between 1 and 59, and it is the only invalid field.
status must be "active" or "inactive"status is missing or not one of the two allowed values, and it is the only invalid field.
Validation failed.More than one field is invalid. details lists one { path, message } entry per invalid field, using the messages above. A single-field failure also carries details.
{
"error": "Validation failed.",
"details": [
{
"path": "type",
"message": "type must be \"shopify-api\""
},
{
"path": "syncPeriod",
"message": "syncPeriod is required and must be 0 (Never) or at least 60 minutes"
}
]
}curl -X POST "https://stylor.ai/api/v1/datasets/YOUR_DATASET_ID/sources" \
-H "Authorization: Bearer $STYLOR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"type": "shopify-api",
"endpoint": "https://example-store.myshopify.com/products.json",
"syncPeriod": 1440,
"status": "active"
}'{
"success": true,
"source": {
"sourceId": "8a4d2f1e-3c5b-4e6a-9d7f-2b1c3d4e5f6a",
"datasetId": "3f1c2a9e-6b7d-4c1e-9a2b-1d4e5f6a7b8c",
"organizationId": "5b7e9c1a-2d4f-4a6b-8c1d-9e2f3a4b5c6d",
"type": "shopify-api",
"status": "active",
"sync": {
"period": 1440,
"previous": null
},
"config": {
"endpoint": "https://example-store.myshopify.com/products.json",
"disableGenerativeAssets": true
},
"createdAt": "2026-09-12T09:15:41.002Z",
"updatedAt": "2026-09-12T09:15:41.002Z"
}
}