What Are Webhooks?¶
Webhooks allow you to automatically create blog and vlog posts in your CMS from external sources like RSS feeds, YouTube channels, or automation tools like Make.com. Instead of manually copying content, webhooks POST data directly to your site to create posts automatically.
Your Webhook Endpoints¶
Your site has dedicated webhook endpoints for automation:
Blog Posts: https://yoursite.webfacemedia.dev/api/webhooks/blog
Vlog Posts: https://yoursite.webfacemedia.dev/api/webhooks/vlogReplace "yoursite" with your actual subdomain.
Required: Webhook API Key¶
Your developer needs to generate and provide you with a WEBHOOK_API_KEY. This key authenticates requests to your webhook endpoints.
How to Get Your Webhook API Key¶
Ask your developer to:
1. Generate a secure random key
2. Add it to your site's environment variables as WEBHOOK_API_KEY
3. Provide you with the key to use in Make.com
Setup with Make.com¶
1. Create Make.com Account¶
Go to make.com/register and sign up (free tier available)
2. Create a New Scenario¶
Click Create a new scenario
Choose a trigger based on your content source:
• RSS Feed - Auto-import from blogs
• YouTube - Auto-import from your channel
• Google Sheets - Bulk import from spreadsheet
• Schedule - Trigger at specific times
3. Add HTTP Module¶
After your trigger, add an HTTP → Make a request module
Configure:
• URL: Your webhook endpoint
• Method: POST
• Headers:
Content-Type: application/json
X-Webhook-Api-Key: your-webhook-api-key4. Map Your Data¶
In the HTTP module body, map your trigger data to the required fields:
For Blog Posts:¶
{
"title": "{{trigger.title}}",
"slug": "{{replace(lower(trigger.title), ' ', '-')}}",
"body": "{{trigger.content}}",
"categoryNames": ["Imported"],
"publishDate": "{{formatDate(now, 'YYYY-MM-DD')}}",
"publish": false
}For Vlog Posts:¶
{
"title": "{{trigger.title}}",
"slug": "{{replace(lower(trigger.title), ' ', '-')}}",
"body": "{{trigger.description}}",
"youtubeUrl": "{{trigger.url}}",
"videoDuration": "{{trigger.duration}}",
"categoryNames": ["YouTube"],
"publish": false
}Example: Auto-Import YouTube Videos¶
Scenario Setup¶
1. Trigger: YouTube → Watch videos in playlist
2. Action: HTTP → Make a request
HTTP Configuration¶
URL: https://yoursite.webfacemedia.dev/api/webhooks/vlog
Method: POST
Headers:
Content-Type: application/json
X-Webhook-Api-Key: your-webhook-api-keyBody:
{
"title": "{{1.title}}",
"slug": "{{replace(lower(1.title), ' ', '-')}}",
"body": "{{1.description}}",
"youtubeUrl": "{{1.url}}",
"videoDuration": "{{1.duration}}",
"imageUrl": "{{1.thumbnail.url}}",
"categoryNames": ["YouTube"],
"publish": false
}Testing Your Automation¶
1. Activate your Make.com scenario
2. Trigger the automation (publish RSS item, upload YouTube video, etc.)
3. Check Make.com execution history for success/errors
4. Verify post appears in Sanity Studio (Blog or Vlog section)
5. Review and publish the post in Sanity Studio
Common Issues¶
401 Unauthorized¶
Check:
• Webhook API key is correct
• Header name is exactly X-Webhook-Api-Key
• Key matches what's in your site's environment variables
400 Validation Failed¶
Check:
• title and body fields are provided
• YouTube URL is valid (for vlogs)
• Date format is YYYY-MM-DD
Posts Not Appearing¶
Remember:
• Posts are created as drafts by default
• Check the Drafts section in Sanity Studio
• Set "publish": true to publish automatically
