Webhooks API reference
Reference documentation for the Webhooks HTTP endpoints.
The Webhooks API allows you to programmatically interact with and monitor webhooks.
In addition to webhooks, you can also react to document changes with Sanity Functions.
Authentication
- All requests must be authenticated.
- Manipulating documents requires read+write access permission for the affected document type. In most cases, this includes the Editor, Developer, or Administrator roles.
Webhook types
Sanity provides two types of webhooks, transaction and document. Document webhooks are preferred because they are more flexible and powerful.
Document
A document webhook triggers every time a document is created, updated, or deleted. If a transaction updates 3 documents, 3 webhooks will be executed. Document webhook also allows for more granular filtering and customizable payloads with GROQ.
Transaction
A transaction webhook triggers once per dataset, meaning if you batch together multiple document mutations in one transaction only one webhook will be executed.
Base API server URL
Sanity API base URL
https://{projectId}.api.sanity.io/{apiVersion}Variables
- projectIdstringdefault:
"projectId"Project ID
- apiVersionstringdefault:
"v2025-02-19"API version