Update a data source

patch/v1/datasets/{datasetId}/sources/{sourceId}

Partially updates a source. Send only the fields you want to change; omitted fields are left untouched. At least one recognised field must be present. type cannot be changed — delete the source and create a new one instead.

Setting status to inactive stops the scheduler from enqueuing jobs and makes Create sync job return 409 Data source is not active. It does not cancel a job that is already pending or processing.

Changing syncPeriod does not reset the schedule: the next automatic sync is still computed from the last successful sync time.

Private keyapi.v1.datasets.sources.updateNo demo

Path parameters

2
datasetIdstring (uuid)required

The dataset the source belongs to.

sourceIdstring (uuid)required

The source to update.

Request body

application/jsonrequired
endpointstring (uri)

New store URL. Must be a string that parses as an absolute URL.

syncPeriodinteger

New automatic sync interval in minutes: 0 (never) or at least 60. Numeric strings are accepted here and fractional values are truncated.

min: 0
statusstring

New scheduling status.

One ofactiveinactive
disableGenerativeAssetsboolean

Must be a boolean if present. Currently always stored as true.

Response

200The updated source.
successbooleanrequired

Always true on a 2xx response.

DataSourcerequired

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.

sourceIdstring (uuid)required

Unique identifier of the source. Generated on create.

e.g. "8a4d2f1e-3c5b-4e6a-9d7f-2b1c3d4e5f6a"
datasetIdstring (uuid)required

The dataset this source feeds.

e.g. "3f1c2a9e-6b7d-4c1e-9a2b-1d4e5f6a7b8c"
organizationIdstring (uuid)required

The organization that owns the source.

e.g. "5b7e9c1a-2d4f-4a6b-8c1d-9e2f3a4b5c6d"
typestringrequired

Connector type. shopify-api reads a Shopify storefront's public products.json.

One ofshopify-api
statusstringrequired

active sources are picked up by the scheduler and accept manual sync jobs. inactive sources are ignored by the scheduler and reject manual jobs.

One ofactiveinactive
objectrequired

Scheduling state.

objectrequired

Connector configuration.

createdAtstring (date-time)required

When the source was created.

e.g. "2026-08-01T14:22:09.101Z"
updatedAtstring (date-time)required

When the source was last modified, including scheduler updates to sync.previous.

e.g. "2026-09-11T03:00:12.420Z"

Errors

27

Every error is JSON with a single error string unless noted. Match on the status code; the message is for humans.

400
Request body must be valid JSON.

The request body is not parseable JSON. This response carries no rate-limit headers.

400
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.

404
Data source not found or access denied

No source with that sourceId belongs to the organization that owns the key, or the source belongs to a different datasetId than the path. Checked after field validation.

422
endpoint must be a string

endpoint is present but not a string (including null), and it is the only invalid field.

422
endpoint must be a valid URL

endpoint is a string that does not parse as an absolute URL, and it is the only invalid field.

422
syncPeriod must be 0 (Never) or at least 60 minutes

syncPeriod is present but not numeric, or is between 1 and 59 after truncation, and it is the only invalid field.

422
status must be "active" or "inactive"

status is present but not one of the two allowed values, and it is the only invalid field.

422
disableGenerativeAssets must be a boolean

disableGenerativeAssets is present but not true or false, and it is the only invalid field.

422
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": "endpoint",
      "message": "endpoint must be a valid URL"
    },
    {
      "path": "status",
      "message": "status must be \"active\" or \"inactive\""
    }
  ]
}
422
No valid fields to update

The body contains none of endpoint, syncPeriod, status or disableGenerativeAssets.

curl -X PATCH "https://stylor.ai/api/v1/datasets/YOUR_DATASET_ID/sources/YOUR_SOURCE_ID" \
  -H "Authorization: Bearer $STYLOR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "syncPeriod": 360
}'
Response · 200
{
  "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": 360,
      "previous": "2026-09-11T03:00:12.418Z"
    },
    "config": {
      "endpoint": "https://example-store.myshopify.com/products.json",
      "disableGenerativeAssets": true
    },
    "createdAt": "2026-08-01T14:22:09.101Z",
    "updatedAt": "2026-09-12T09:31:07.555Z"
  }
}