Hazel

Getting Started

Create a webhook and send your first message

This guide walks you through creating a webhook and sending messages to a Hazel channel.

Create a Webhook

Open Channel Settings

Navigate to the channel where you want to receive webhook messages. Click the channel name to open settings, then select the Webhooks tab.

Create New Webhook

Click Create Webhook and fill in the details:

  • Name (required) - A display name for the webhook (e.g., "GitHub Actions", "Uptime Monitor")
  • Description (optional) - A note about what this webhook is for
  • Avatar URL (optional) - Custom avatar image for webhook messages

Copy the Webhook URL

After creating the webhook, you'll see the full webhook URL with the token. Copy this immediately - the token is only shown once for security reasons.

The URL format is:

https://api.hazel.app/webhooks/incoming/{webhookId}/{token}

If you lose the token, you can regenerate it from the webhook settings, but this will invalidate the old URL.

Send Your First Message

Plain Text Message

Send a simple text message using curl:

curl -X POST "YOUR_WEBHOOK_URL" \
  -H "Content-Type: application/json" \
  -d '{"content": "Hello from my webhook!"}'

Message with Embed

Send a formatted message with an embed:

curl -X POST "YOUR_WEBHOOK_URL" \
  -H "Content-Type: application/json" \
  -d '{
    "embeds": [{
      "title": "Build Successful",
      "description": "All tests passed",
      "color": 5025616,
      "fields": [
        {"name": "Branch", "value": "main", "inline": true},
        {"name": "Commit", "value": "abc1234", "inline": true}
      ]
    }]
  }'

Using JavaScript/TypeScript

const webhookUrl = "YOUR_WEBHOOK_URL"

await fetch(webhookUrl, {
	method: "POST",
	headers: { "Content-Type": "application/json" },
	body: JSON.stringify({
		content: "Deployment complete!",
		embeds: [
			{
				title: "Production Deploy",
				description: "v1.2.3 is now live",
				color: 5025616,
				timestamp: new Date().toISOString(),
			},
		],
	}),
})

Request Format

Endpoint

POST /webhooks/incoming/{webhookId}/{token}

Headers

HeaderValueRequired
Content-Typeapplication/jsonYes

Body

{
  content?: string      // Plain text message
  embeds?: Embed[]      // Array of embeds (max 10)
}

At least one of content or embeds must be provided.

Response

Success (200):

{
	"messageId": "msg_abc123",
	"channelId": "ch_xyz789"
}

Error (4xx/5xx):

{
	"error": "Error message describing what went wrong"
}

Security Best Practices

Next Steps

On this page