Activate dataset

patch/v1/datasets/{datasetId}/activate

Sets a dataset's status to active, making it eligible for search, chat, outfit generation and the widget. Any number of datasets can be active at the same time.

When the dataset was not already active, related records are brought back with it:

  • data sources that were switched off by an archive are set back to active, so scheduled syncs resume;
  • items that were archived are set back to active.

Calling this on a dataset that is already active is harmless — the response has alreadyActive: true and nothing else changes.

Good to know

  • Queue rows that were archived are not re-queued by activation. Re-upload those items if you need them processed.
  • archivedOthersCount is always 0; it remains for compatibility with an earlier behaviour that archived sibling datasets.
  • The returned dataset is the stored record as-is and additionally carries the database's _id and __v bookkeeping fields. Ignore them.
Private keyapi.v1.datasets.activateNo demo

Path parameters

1
datasetIdstring (uuid)required

The dataset to activate.

Response

200The dataset is active.
activatedbooleanrequired

Always true on success.

alreadyActivebooleanrequired

true when the dataset was already active and no cascade ran.

archivedOthersCountintegerrequired

Always 0. Kept for compatibility with an earlier single-active-dataset behaviour.

Datasetrequired

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.

datasetIdstring (uuid)required

Unique id of the dataset. Use it as the datasetId path parameter.

e.g. "c9b3c6c0-9b0f-4f42-bf3f-2b7a6b1b9d31"
organizationIdstring (uuid)required

Id of the organization that owns the dataset — the one behind your API key.

e.g. "0a2c1f4e-5b6d-7e8f-9012-3456789abcde"
statusstringrequired

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.

One ofdraftactivearchived
default: "draft"
namestringrequired

Display name. Trimmed on create; cut to 200 characters on update.

e.g. "Spring 2026"
descriptionstring

Free-text description. Defaults to an empty string; cut to 2000 characters on update.

e.g. "Women's spring drop"
metadataobject

Arbitrary JSON you attach to the dataset. Omitted when never set. Replaced wholesale by *Update dataset*.

DatasetConfigrequired

Store details attached to a dataset. Set on create, editable field-by-field on update.

autoPublishbooleanrequired

Whether newly processed items go live automatically. Set on create; true unless explicitly false.

default: true
createdAtstring (date-time)required

When the dataset was created.

e.g. "2026-03-02T09:14:31.208Z"
updatedAtstring (date-time)required

When the dataset record was last written.

e.g. "2026-08-19T16:40:02.911Z"

Errors

20

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

401
Organization '<organizationId>' not found.

The organization that owns the key no longer exists.

404
Dataset '<datasetId>' not found for organization '<organizationId>'.

No dataset with that id belongs to your organization.

422
Invalid 'datasetId': expected a non-empty string.

datasetId is empty.

curl -X PATCH "https://stylor.ai/api/v1/datasets/YOUR_DATASET_ID/activate" \
  -H "Authorization: Bearer $STYLOR_API_KEY"
Response · 200
{
  "activated": true,
  "alreadyActive": false,
  "archivedOthersCount": 0,
  "dataset": {
    "datasetId": "c9b3c6c0-9b0f-4f42-bf3f-2b7a6b1b9d31",
    "organizationId": "0a2c1f4e-5b6d-7e8f-9012-3456789abcde",
    "status": "active",
    "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",
      "targetGender": "womens"
    },
    "autoPublish": true,
    "createdAt": "2026-03-02T09:14:31.208Z",
    "updatedAt": "2026-09-12T10:05:12.402Z"
  }
}