Sanity · AsyncAPI Specification
Sanity GROQ-Powered Webhooks
Version 1.0.0
AsyncAPI specification for Sanity's GROQ-powered webhook surface. Sanity delivers event-driven HTTP callbacks when documents in a Content Lake dataset are created, updated, or deleted. Subscribers configure a webhook with a GROQ filter (selecting which documents trigger delivery) and an optional GROQ projection (shaping the request body). Sanity then POSTs (or PUTs/PATCHes/DELETEs/GETs, per webhook configuration) the resulting payload to the subscriber's URL, along with a set of standard and Sanity-specific headers identifying the originating transaction, dataset, document, and operation. By default webhooks ignore draft and version documents.
View Spec
View on GitHub
Headless CMSContent ManagementGROQReal-TimeStructured ContentDeveloper PlatformAsyncAPIWebhooksEvents
Channels
document/create
Document created event delivery.
Delivered when a document matching the webhook's GROQ filter is created in the configured dataset. The sanity-operation header is set to "create".
document/update
Document updated event delivery.
Delivered when a document matching the webhook's GROQ filter is changed. The sanity-operation header is set to "update". delta::changedAny and before()/after() may be used in the projection to inspect the change.
document/delete
Document deleted event delivery.
Delivered when a document matching the webhook's GROQ filter is deleted. The sanity-operation header is set to "delete".
Messages
DocumentCreated
Document Created
A document matching the webhook filter was created.
DocumentUpdated
Document Updated
A document matching the webhook filter was changed.
DocumentDeleted
Document Deleted
A document matching the webhook filter was deleted.
Servers
https
subscriber
{webhookUrl}
Subscriber-controlled HTTPS endpoint that Sanity delivers webhook requests to. The URL is configured per webhook on the Sanity project.