Skip to content

Archive a dataset

client.datasets.archive(stringdatasetID, RequestOptionsoptions?): DatasetArchiveResponse { id, deleted, object }
DELETE/v5/datasets/{dataset_id}

Soft-delete a dataset by archiving it; the row is retained and can be restored later.

This sets the dataset’s archived_at timestamp rather than permanently removing it, and cascades the same archival to the dataset’s items and versions. Archiving is not idempotent: if the dataset is already archived the call fails. The dataset can be brought back with the PATCH restore request. The response reports the dataset id with deleted set to true.

ParametersExpand Collapse
datasetID: string
ReturnsExpand Collapse
DatasetArchiveResponse { id, deleted, object }
id: string
deleted: boolean
object?: "dataset"

Archive a dataset

import SGPClient from 'scale-gp';

const client = new SGPClient({
  accountID: 'My Account ID',
  apiKey: process.env['SGP_API_KEY'], // This is the default and can be omitted
});

const response = await client.datasets.archive('dataset_id');

console.log(response.id);
{
  "id": "id",
  "deleted": true,
  "object": "dataset"
}
Returns Examples
{
  "id": "id",
  "deleted": true,
  "object": "dataset"
}