Skip to main content

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 match SANITY_WEBHOOK_SECRET)

Request Body: Sanity webhook payload

Response:

{
"success": true,
"invalidated": ["content:locale:en", "content:locale:es"]
}

Setup

  1. Configure webhook in Sanity Manage
  2. Set SANITY_WEBHOOK_SECRET environment variable
  3. Webhook URL: https://your-domain.com/api/webhooks/sanity

See Sanity Webhooks for detailed setup instructions.

Next Steps