younifyd
Menu

Create Dataset

Create a dataset

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

Use it in a workflow

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

Request

Path parameters

projectIdstringrequired
namestringrequired

Request body

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

aclModestring

The ACL mode to set for the new dataset. Defaults to public. Setting `private` requires the private datasets feature, and `custom` requires the third-party login feature. Otherwise, the request fails with `ACL mode "<mode>" not allowed for this project`.

One ofpublicprivatecustomDefault "public"

descriptionstring | null

A description of the dataset.

embeddingsobject

The settings for the embeddings index for the dataset.

enabledbooleanrequired

Whether the embeddings index is enabled for the dataset. Required when you include `embeddings`.

projectionstring

The GROQ projection that defines which fields to include in the embeddings index. If you don't include a projection, we process the entire document JSON into a less verbose format and embed all of it. Example: "{title, author}" or "{...}" for all fields

json
{
  "aclMode": "public",
  "description": "string",
  "embeddings": {
    "enabled": false,
    "projection": "{title, author}"
  }
}

Response

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

datasetNamestring
aclModestring
descriptionstring | null
datasetProfilestring

Only returned on API version v2023-11-13 or later.

addonForstring

Only returned on API version v2023-11-13 or later.

featuresarray<string>

Only returned on API version v2023-11-13 or later.

json
{
  "datasetName": "string",
  "aclMode": "string",
  "description": "string",
  "datasetProfile": "string",
  "addonFor": "string",
  "features": [
    "string"
  ]
}

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