Archive dataset

patch/v1/datasets/{datasetId}/archive

Sets a dataset's status to archived, taking it out of search, chat, outfit generation and the widget while keeping all of its data. Use it for seasonal catalogues you expect to bring back; use Delete dataset when the data should go too.

When the dataset was not already archived, related records follow it:

  • active data sources are set to inactive, which stops scheduled syncs;
  • active items are set to archived;
  • queue rows that were pending or partial_update are set to archived, so they will not be processed.

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

Good to know

  • Activate dataset reverses the source and item changes, but archived queue rows stay archived.
  • 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.archiveNo demo

Path parameters

1
datasetIdstring (uuid)required

The dataset to archive.

Response

200The dataset is archived.
archivedbooleanrequired

Always true on success.

alreadyArchivedbooleanrequired

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

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/archive" \
  -H "Authorization: Bearer $STYLOR_API_KEY"
Response · 200
{
  "archived": true,
  "alreadyArchived": false,
  "dataset": {
    "datasetId": "c9b3c6c0-9b0f-4f42-bf3f-2b7a6b1b9d31",
    "organizationId": "0a2c1f4e-5b6d-7e8f-9012-3456789abcde",
    "status": "archived",
    "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:07:55.019Z"
  }
}