Webhook Endpoints
Webhook endpoints for external integrations.
POST /api/webhooks/sanity
Sanity webhook endpoint for automatic cache invalidation.
Purpose: Receives webhooks from Sanity when content is published/updated.
Headers:
Authorization: Bearer <token>(must matchSANITY_WEBHOOK_SECRET)
Request Body: Sanity webhook payload
Response:
{
"success": true,
"invalidated": ["content:locale:en", "content:locale:es"]
}
Setup
- Configure webhook in Sanity Manage
- Set
SANITY_WEBHOOK_SECRETenvironment variable - Webhook URL:
https://your-domain.com/api/webhooks/sanity
See Sanity Webhooks for detailed setup instructions.