Sanity · Arazzo Workflow

Sanity Register Webhook for Query

Version 1.0.0

Validate a GROQ filter, register a webhook on it, then list webhooks.

1 workflow 1 source API 1 provider
View Spec View on GitHub Headless CMSContent ManagementGROQReal-TimeStructured ContentDeveloper PlatformArazzoWorkflows

Provider

sanity

Workflows

register-webhook-for-query
Confirm a GROQ filter resolves, then register and verify a webhook on it.
Runs the GROQ filter as a query to validate it, creates a webhook bound to that filter and the requested event types, and lists the project's webhooks to confirm the new webhook is present.
3 steps inputs: True, apiToken, dataset, filter, projectId, webhookName, webhookUrl outputs: webhookId, webhooks
1
validateFilter
queryDocumentsPost
Run the GROQ filter as a query so an invalid filter is caught before a webhook is registered against it.
2
createWebhook
createWebhook
Register a webhook bound to the validated GROQ filter and the requested document event types.
3
listWebhooks
listWebhooks
List the project's webhooks to confirm the new webhook is present.

Source API Descriptions

Arazzo Workflow Specification

Raw ↑
arazzo: 1.0.1
info:
  title: Sanity Register Webhook for Query
  summary: Validate a GROQ filter, register a webhook on it, then list webhooks.
  description: >-
    The change-notification setup pattern. The workflow first runs the intended
    GROQ filter as a query to confirm it is valid and resolves against the
    dataset, then registers a webhook that fires on the requested document
    events for that same filter, and finally lists the project's webhooks to
    confirm the registration. Every step spells out its request inline so the
    flow can be read and executed without opening the underlying OpenAPI
    description.
  version: 1.0.0
sourceDescriptions:
- name: sanityApi
  url: ../openapi/sanity-openapi.yml
  type: openapi
workflows:
- workflowId: register-webhook-for-query
  summary: Confirm a GROQ filter resolves, then register and verify a webhook on it.
  description: >-
    Runs the GROQ filter as a query to validate it, creates a webhook bound to
    that filter and the requested event types, and lists the project's webhooks
    to confirm the new webhook is present.
  inputs:
    type: object
    required:
    - projectId
    - apiToken
    - dataset
    - filter
    - webhookName
    - webhookUrl
    - on
    properties:
      projectId:
        type: string
        description: The project id the webhook is registered against.
      apiToken:
        type: string
        description: Sanity API token used as a Bearer credential.
      dataset:
        type: string
        description: Dataset the webhook and validation query target.
      filter:
        type: string
        description: GROQ filter expression selecting documents to notify on.
      webhookName:
        type: string
        description: Human-readable name for the webhook.
      webhookUrl:
        type: string
        description: Destination URL the webhook posts events to.
      on:
        type: array
        description: Document events to fire on (create, update, delete).
        items:
          type: string
  steps:
  - stepId: validateFilter
    description: >-
      Run the GROQ filter as a query so an invalid filter is caught before a
      webhook is registered against it.
    operationId: queryDocumentsPost
    parameters:
    - name: Authorization
      in: header
      value: "Bearer $inputs.apiToken"
    - name: dataset
      in: path
      value: $inputs.dataset
    requestBody:
      contentType: application/json
      payload:
        query: "*[$filter][0...1]"
        params:
          filter: $inputs.filter
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      sample: $response.body#/result
  - stepId: createWebhook
    description: >-
      Register a webhook bound to the validated GROQ filter and the requested
      document event types.
    operationId: createWebhook
    parameters:
    - name: Authorization
      in: header
      value: "Bearer $inputs.apiToken"
    - name: projectId
      in: path
      value: $inputs.projectId
    requestBody:
      contentType: application/json
      payload:
        name: $inputs.webhookName
        url: $inputs.webhookUrl
        dataset: $inputs.dataset
        filter: $inputs.filter
        on: $inputs.on
    successCriteria:
    - condition: $statusCode == 201
    outputs:
      webhookId: $response.body#/id
  - stepId: listWebhooks
    description: List the project's webhooks to confirm the new webhook is present.
    operationId: listWebhooks
    parameters:
    - name: Authorization
      in: header
      value: "Bearer $inputs.apiToken"
    - name: projectId
      in: path
      value: $inputs.projectId
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      webhooks: $response.body
  outputs:
    webhookId: $steps.createWebhook.outputs.webhookId
    webhooks: $steps.listWebhooks.outputs.webhooks

Work with this as data

Every workflow here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for arazzo workflows

4 MCP tools reach this
  • find_arazzoBrowse and filter every workflow in the catalog.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools

Call it yourself

curl for this page
This workflow
curl "https://apis.io/api/v1/arazzo/sanity-register-webhook-for-query-workflow"
All arazzo workflows
curl "https://apis.io/api/v1/arazzo?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no email required.

A second provider on the same verified email joins the account you already have.