Connecting Sanity

Last updated: March 6, 2026

This guide walks you through connecting your Sanity project to Engaige using an HTTP integration, so you can create actions that read or write content from your Sanity Content Lake. You can always refer to Sanity's API docs.

Prerequisites

  • A Sanity account with an existing project

  • Access to manage.sanity.io

  • Access to your Engaige dashboard with permission to manage integrations

Step 1 — Find your Sanity Project ID and Dataset name

  1. Go to manage.sanity.io

  2. Select your project

  3. On the project overview page, copy your Project ID (e.g. abc123xyz)

  4. Note your Dataset name — typically production unless you've created custom datasets (visible under Datasets in the left sidebar)

Step 2 — Create a Sanity API Token

Engaige needs a Robot Token to authenticate with the Sanity API on your behalf.

  1. In manage.sanity.io, open your project

  2. In the left sidebar, go to Settings → API → Tokens

  3. Click Add new token

  4. Give it a descriptive name, e.g. Engaige Integration

  5. Choose the appropriate permission level:

    • Viewer — read-only access (recommended if you only need to fetch content)

    • Editor — read and write access (required if you need to create/update documents)

  6. Click Save

  7. Copy the token immediately — Sanity only shows it once. Store it securely.

Step 3 — Create the HTTP Integration in Engaige

  1. Log in to your Engaige dashboard

  2. Navigate to Settings → Integrations → HTTP

  3. Click Enable

Screenshot 2026-03-05 at 15.15.45.pngScreenshot 2026-03-05 at 12.09.24.png
  1. Fill in the following fields:

FieldValue

Integration name

Sanity (or any name you prefer)

Domain

<your-project-id>.api.sanity.io

Authentication method

Bearer Token

Bearer token

Paste the API token you copied in Step 2

  1. Click Save

Step 4 — Create an HTTP Action linked to Sanity

Now you can create an action that calls the Sanity API.

Screenshot 2026-03-06 at 17.43.37.pngScreenshot 2026-03-06 at 17.41.28.png
  1. In Engaige, go to Actions and click Add new action

  2. Select Call API as the action type

  3. Link it to the Sanity integration you just created

  4. Configure the request:

To query content (GROQ query):

  • Method: GET or POST

  • Path template: /v2021-06-07/data/query/<your-dataset>

    • e.g. /v2021-06-07/data/query/production

  • For a GET request, append your GROQ query as a URL parameter:
    /v2021-06-07/data/query/production?query=*[_type == "article"]

To mutate/write content:

  • Method: POST

  • Path template: /v2021-06-07/data/mutate/<your-dataset>

  • Body template: A JSON payload containing your mutations

  1. Save the action

Step 5 — Test the Integration

  1. In the Engaige dashboard, find your Sanity integration

  2. Use the Test option to verify the connection succeeds

  3. Trigger your action in a test conversation to confirm it returns the expected Sanity data

Quick Reference

ItemValue

Sanity API base URL

https://<projectId>.api.sanity.io

CDN base URL (read-only, cached)

https://<projectId>.apicdn.sanity.io

Query endpoint

/v2021-06-07/data/query/<dataset>

Mutate endpoint

/v2021-06-07/data/mutate/<dataset>

Auth header

Authorization: Bearer <token>

Token management

manage.sanity.io → Settings → API → Tokens

Security note: Use a dedicated Robot Token (not your personal token) for any integration. Only grant the minimum permission level needed — use Viewer for read-only use cases.