younifyd
Menu

Update Webhook

Update a webhook

PATCH/hooks/projects/{projectId}/{id}

Use it in a workflow

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

Request

Path parameters

projectIdstringrequired
idstringrequired

Request body

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

namestring

Name of webhook

urlstring

The endpoint to which the webhook request is sent

datasetstring

Which dataset should this trigger for. '*' means all datasets in the project

descriptionstring

Optional description to add helpful context to the webhook

ruleobject

Configuration for when and how the webhook should trigger

onarray<string>required
filterstring

GROQ filter specifying which documents trigger the webhook

projectionstring

GROQ projection defining the payload of the webhook request

apiVersionstring

Which API version to use for the GROQ filter and projection. Use the format `vYYYY-MM-DD`, or `vX`.

httpMethodstring

HTTP method of the webhook request

One ofPOSTPUTPATCHDELETEGET

includeDraftsboolean

Set to trigger on changes to draft documents.

includeAllVersionsboolean

Set to trigger on changes to version documents.

headersobject

Additional HTTP headers sent with the webhook request

secretstring

Secret used to sign outgoing webhook requests

isDisabledByUserboolean

Set to 'true' to disable the webhook and prevent it from triggering

json
{
  "name": "string",
  "url": "string",
  "dataset": "string",
  "description": "string",
  "rule": {
    "on": [
      "create"
    ],
    "filter": "string",
    "projection": "string"
  },
  "apiVersion": "string",
  "httpMethod": "POST",
  "includeDrafts": false,
  "includeAllVersions": false,
  "headers": {},
  "secret": "string",
  "isDisabledByUser": false
}

Response

Returns 200 with a oneOf. Read it in later steps with {{updateWebhook.response.data.<field>}}.

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

Was this page helpful?