Skip to content
For LLMsView as Markdown·

Sanity ​

undefined

DetailValue
CategoryCMS
Base URLhttps://{project_id}.api.sanity.io/v2021-10-21
AuthenticationBearer Token
Endpoints7
Connector keysanity

Using Sanity in a workflow ​

  1. Go to Connections and click New Connection.
  2. Pick Sanity from the marketplace.
  3. Enter your credentials (see Authentication above for what's expected).
  4. In a workflow, drop an API Call node and select this connection.
  5. Pick the operation you need from the Operation dropdown. The full list is below.

Available endpoints ​

EndpointSummary
GET Query Documents (GROQ)
GET Mutate Documents
GET Get Document
GET Export Dataset
GET Upload Image
GET Upload File
GET List Projects

Each endpoint is documented in full below. Use the outline on the right to jump to one.

GET ​

Query Documents (GROQ)

DetailValue
Operation IDquery_documents_groq__0
MethodGET
Path``

Parameters ​

No parameters.

Using this endpoint in a workflow ​

  1. Add an API Call node to your workflow.
  2. Pick your Sanity connection from the Connection dropdown.
  3. In the Operation dropdown, select query_documents_groq__0.
  4. Fill in the parameter fields that appear. Use {{...}} to reference upstream values.

What it returns ​

The API Call node writes the response to the workflow context:

{
  status: 200,
  success: true,
  data: { ...response body from the API... },
  latencyMs: 142
}

Reference response fields downstream as {{nodeId.data.path}}. The exact response shape is documented on the upstream Sanity API reference.

GET ​

Mutate Documents

DetailValue
Operation IDmutate_documents_1
MethodGET
Path``

Parameters ​

No parameters.

Using this endpoint in a workflow ​

  1. Add an API Call node to your workflow.
  2. Pick your Sanity connection from the Connection dropdown.
  3. In the Operation dropdown, select mutate_documents_1.
  4. Fill in the parameter fields that appear. Use {{...}} to reference upstream values.

What it returns ​

The API Call node writes the response to the workflow context:

{
  status: 200,
  success: true,
  data: { ...response body from the API... },
  latencyMs: 142
}

Reference response fields downstream as {{nodeId.data.path}}. The exact response shape is documented on the upstream Sanity API reference.

GET ​

Get Document

DetailValue
Operation IDget_document_2
MethodGET
Path``

Parameters ​

No parameters.

Using this endpoint in a workflow ​

  1. Add an API Call node to your workflow.
  2. Pick your Sanity connection from the Connection dropdown.
  3. In the Operation dropdown, select get_document_2.
  4. Fill in the parameter fields that appear. Use {{...}} to reference upstream values.

What it returns ​

The API Call node writes the response to the workflow context:

{
  status: 200,
  success: true,
  data: { ...response body from the API... },
  latencyMs: 142
}

Reference response fields downstream as {{nodeId.data.path}}. The exact response shape is documented on the upstream Sanity API reference.

GET ​

Export Dataset

DetailValue
Operation IDexport_dataset_3
MethodGET
Path``

Parameters ​

No parameters.

Using this endpoint in a workflow ​

  1. Add an API Call node to your workflow.
  2. Pick your Sanity connection from the Connection dropdown.
  3. In the Operation dropdown, select export_dataset_3.
  4. Fill in the parameter fields that appear. Use {{...}} to reference upstream values.

What it returns ​

The API Call node writes the response to the workflow context:

{
  status: 200,
  success: true,
  data: { ...response body from the API... },
  latencyMs: 142
}

Reference response fields downstream as {{nodeId.data.path}}. The exact response shape is documented on the upstream Sanity API reference.

GET ​

Upload Image

DetailValue
Operation IDupload_image_4
MethodGET
Path``

Parameters ​

No parameters.

Using this endpoint in a workflow ​

  1. Add an API Call node to your workflow.
  2. Pick your Sanity connection from the Connection dropdown.
  3. In the Operation dropdown, select upload_image_4.
  4. Fill in the parameter fields that appear. Use {{...}} to reference upstream values.

What it returns ​

The API Call node writes the response to the workflow context:

{
  status: 200,
  success: true,
  data: { ...response body from the API... },
  latencyMs: 142
}

Reference response fields downstream as {{nodeId.data.path}}. The exact response shape is documented on the upstream Sanity API reference.

GET ​

Upload File

DetailValue
Operation IDupload_file_5
MethodGET
Path``

Parameters ​

No parameters.

Using this endpoint in a workflow ​

  1. Add an API Call node to your workflow.
  2. Pick your Sanity connection from the Connection dropdown.
  3. In the Operation dropdown, select upload_file_5.
  4. Fill in the parameter fields that appear. Use {{...}} to reference upstream values.

What it returns ​

The API Call node writes the response to the workflow context:

{
  status: 200,
  success: true,
  data: { ...response body from the API... },
  latencyMs: 142
}

Reference response fields downstream as {{nodeId.data.path}}. The exact response shape is documented on the upstream Sanity API reference.

GET ​

List Projects

DetailValue
Operation IDlist_projects_6
MethodGET
Path``

Parameters ​

No parameters.

Using this endpoint in a workflow ​

  1. Add an API Call node to your workflow.
  2. Pick your Sanity connection from the Connection dropdown.
  3. In the Operation dropdown, select list_projects_6.
  4. Fill in the parameter fields that appear. Use {{...}} to reference upstream values.

What it returns ​

The API Call node writes the response to the workflow context:

{
  status: 200,
  success: true,
  data: { ...response body from the API... },
  latencyMs: 142
}

Reference response fields downstream as {{nodeId.data.path}}. The exact response shape is documented on the upstream Sanity API reference.