younifyd
Menu

Copy Dataset

Copy

PUT/projects/{projectId}/datasets/{dataset}/copy

Use it in a workflow

  1. Add a step and choose the Sanity connector.
  2. Pick the Copy Dataset action (under Dataset Copy).
  3. Fill in the fields below, then reference the result from later steps as {{copyDataset.response.data}}.

Request

Path parameters

projectIdstringrequired
datasetstringrequired

Request body

Enter the body as JSON in the step's Body field.

targetDatasetstringrequired

The name of the new dataset. Must adhere to the [dataset naming requirements](https://www.sanity.io/docs/content-lake/datasets).

skipHistoryboolean

If true, it skips document history while copying the dataset. This can reduce copy time on datasets with a large edit history. [Check the retention period](https://www.sanity.io/docs/user-guides/history-experience) to find out how long a dataset's history is kept.

Default false

skipContentReleasesboolean

If true, content releases aren't copied. This skips both the release documents and the document versions that belong to them. Copied releases count against your organization's release quota.

Default false

json
{
  "targetDataset": "production-copy",
  "skipHistory": false,
  "skipContentReleases": false
}

Response

Returns 201 with an object. Read it in later steps with {{copyDataset.response.data.<field>}}.

datasetNamestring

The name of the source dataset.

messagestring

A message indicating the status of the copy operation.

aclModestring

The ACL mode of the source dataset.

jobIdstring

The ID of the job that is running the copy operation.

json
{
  "datasetName": "production",
  "message": "Starting copying dataset production to production-copy...",
  "aclMode": "public",
  "jobId": "jacsfsmnxp"
}

Need more? See the Sanity guide for connection setup and behaviour shared by every action.

Copy Dataset — Sanity — Documentation