younifyd
Menu

Post Embeddings Index Dataset

Create an embeddings index

POST/embeddings-index/{dataset}

Use it in a workflow

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

Request

Path parameters

datasetstringrequired

The name of the dataset to use for the request

Request body

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

indexNamestringrequired

The name of the embeddings index you want to create

projectionstringrequired

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

filterstringrequired

The GROQ filter that defines which documents to include in the embeddings index. The filter must be a valid GROQ filter without the square brackets that wrap the value assigned to _type. Example: "_type=='movie'" or "_type in ['article', 'blogPost']"

json
{
  "indexName": "string",
  "projection": "string",
  "filter": "string"
}

Response

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

statusstring

One ofok

messagestring
indexobject
statusstring

One ofpending

indexNamestring
projectIdstring
datasetstring
projectionstring
filterstring
createdAtstring (date-time)
updatedAtstring (date-time)
failedDocumentCountinteger
startDocumentCountinteger
remainingDocumentCountinteger
webhookIdstring
json
{
  "status": "ok",
  "message": "string",
  "index": {
    "status": "pending",
    "indexName": "string",
    "projectId": "string",
    "dataset": "string",
    "projection": "string",
    "filter": "string",
    "createdAt": "2025-01-01T00:00:00Z",
    "updatedAt": "2025-01-01T00:00:00Z",
    "failedDocumentCount": 0,
    "startDocumentCount": 0,
    "remainingDocumentCount": 0,
    "webhookId": "string"
  }
}

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