Overview
Channel webhooks allow you to:- Receive messages from external services via HTTP POST
- Authenticate requests with unique webhook tokens
- Customize bot appearance with names and avatars
- Enable/disable webhooks without deleting them
- Regenerate tokens when needed
Creating Webhooks
Send Messages
Post messages by sending a POST request with JSON payload:The message will appear in the channel as if sent by the webhook bot.
Integration Providers
Webhooks can use global integration bot users for consistent branding:Message Format
Simple Text Message
Rich Content
Webhooks support the same message format as the bot API:- Bold with
**text** - Italic with
*text* - Code with
`code` - Links with
[text](url)
Managing Webhooks
List Webhooks
Update Webhook
Regenerate Token
If a token is compromised, regenerate it:Disable Webhook
Temporarily disable without deleting:Delete Webhook
Webhook Schema
Each webhook includes:packages/domain/src/models/channel-webhook-model.ts:6-25
RPC Schema Reference
Create Webhook
packages/domain/src/rpc/channel-webhooks.ts:76-87
Update Webhook
packages/domain/src/rpc/channel-webhooks.ts:115-125
Common Use Cases
GitHub Actions Deployment
.github/workflows/deploy.yml
Monitoring Alerts
monitoring-alert.ts
Railway Deployments
Custom Application
app.ts
Error Handling
Common Errors
| Error | Cause | Solution |
|---|---|---|
ChannelWebhookNotFoundError | Invalid webhook ID | Verify the webhook exists |
ChannelNotFoundError | Invalid channel ID | Verify the channel exists and you have access |
UnauthorizedError | User not authorized | Must be organization admin to manage webhooks |
401 Unauthorized (HTTP) | Invalid token | Regenerate webhook token |
404 Not Found (HTTP) | Webhook deleted or disabled | Create new webhook |
HTTP Response Codes
Webhook POST requests return:200 OK- Message posted successfully401 Unauthorized- Invalid or expired token404 Not Found- Webhook not found or disabled500 Internal Server Error- Server error
Best Practices
Secure Token Storage
Store webhook tokens securely:
- Use environment variables or secrets managers
- Never commit tokens to version control
- Rotate tokens if compromised
Use Dedicated Channels
Create separate channels for different webhook types:
#deployments- Deployment notifications#alerts- Monitoring alerts#releases- Release announcements
Next Steps
Build a Bot
Create custom bots with the Hazel Bot SDK
GitHub Integration
Subscribe channels to GitHub repositories