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 and any pending sync jobs. Sync history logs are removed shortly afterwards.

The dataset, items, embeddings, queue rows, sources and sync jobs are removed in a single transaction — if any step fails, nothing is deleted.

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 were removed. Counts for embeddings and sync logs 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

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, 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
}