
Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag storeThe error you're seeing ("Cannot send an empty message", "code": 50006) from Discord is happening because your webhook is sending an empty payload to Discord's webhook endpoint. Discord webhooks require specific fields like content, embeds, or file to be present - they can't accept completely empty messages.
The issue is almost certainly with your Projection field in the Sanity webhook configuration. When you leave the Projection field blank, Sanity sends an empty body to Discord, which triggers this exact error.
Here's how to fix it:
In your webhook configuration in Sanity, you need to add a GROQ projection that formats the data specifically for Discord's API. Discord expects a JSON object with at minimum a content field containing the message text.
Try adding this to your Projection field:
{
"content": "New document: " + ^.name + " (Type: " + ^._type + ")"
}This will send a simple text message to Discord with the document name and type. The ^ syntax refers to the document that triggered the webhook.
For richer messages, you can use Discord's embed format:
{
"content": "Content updated in Sanity!",
"embeds": [{
"title": ^.title,
"description": ^.description,
"color": 5814783,
"fields": [
{
"name": "Document Type",
"value": ^._type
}
]
}]
}content field with some texttitle, name, etc.) actually exist on your documentsThis is a common gotcha when setting up Discord webhooks with Sanity - Discord is strict about requiring actual message content, and an empty projection means an empty message body! You can read more about how projections work in Sanity webhooks to customize your messages further.
Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.
Content operations
Content backend


The only platform powering content operations
By Industry


Tecovas strengthens their customer connections
Build and Share

Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag store