Delete dataset

delete/v1/datasets/{datasetId}

Permanently deletes a dataset together with everything inside it: processed items, their embeddings, queued ingest rows, the data sources that feed it, their sync jobs and sync logs, and the stored product photos.

The dataset, its data sources and their sync jobs are removed in a single transaction; if any step fails, nothing is deleted. Everything else the dataset held (items, embeddings, queue rows, sync logs, photos) is removed in the background straight after, usually within seconds, and the removal is resumed automatically if it is interrupted. The dataset disappears from every endpoint as soon as the response is sent.

This cannot be undone. If you only want to take a dataset out of rotation, use Archive dataset instead; it keeps the data and can be reversed.

The response reports how many records of each kind the dataset held when it was deleted. Counts for embeddings, sync logs and photos are not included.

Private keyapi.v1.datasets.deleteNo demo

Path parameters

1
datasetIdstring (uuid)required

The dataset to delete.

Response

200The dataset and its contents were deleted.
deletedbooleanrequired

Always true on success.

deletedCountintegerrequired

Dataset records removed. Always 1 on success.

itemsDeletedCountintegerrequired

Processed items the dataset held. The dataset is gone at once; its items, their photos and search entries are removed in the background, usually within seconds.

queuedDeletedCountintegerrequired

Ingest-queue rows the dataset held, removed with its items.

sourcesDeletedCountintegerrequired

Data sources removed.

syncJobsDeletedCountintegerrequired

Pending sync jobs removed.

Errors

28

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

401
Organization not found. Please check the organizationId.

The organization that owns the key no longer exists.

404
Dataset not found for this organization.

No dataset with that id belongs to your organization, or it vanished while the transaction ran. Nothing was deleted.

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

datasetId is empty.

curl -X DELETE "https://stylor.ai/api/v1/datasets/YOUR_DATASET_ID" \
  -H "Authorization: Bearer $STYLOR_API_KEY"
Response · 200
{
  "deleted": true,
  "deletedCount": 1,
  "itemsDeletedCount": 1296,
  "queuedDeletedCount": 5,
  "sourcesDeletedCount": 1,
  "syncJobsDeletedCount": 0
}