younifyd
Menu

Copy Dataset Projects Api

Copy a dataset

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

Use it in a workflow

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

Request

Path parameters

projectIdstringrequired

The unique ID of the project.

namestringrequired

The name of the dataset to copy.

Request body

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

targetDatasetstringrequired

The name of the new dataset to create.

skipHistoryboolean

If true, revision history is not copied, which will usually result in a much faster copy. If false or omitted, revision history is copied to targetDataset.

Default false

skipContentReleasesboolean

If true, content release documents are not copied to targetDataset.

Default false

aclModestring

Deprecated. The API accepts this field for backward compatibility but ignores it.

json
{
  "targetDataset": "string",
  "skipHistory": false,
  "skipContentReleases": false,
  "aclMode": "string"
}

Response

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

datasetNamestring

The name of the source dataset.

messagestring
aclModestring

The ACL mode of the source dataset.

jobIdstring

The ID of the copy job. Use it with the Jobs API to check the status of the copy.

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

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

Copy Dataset Projects Api — Sanity — Documentation