Webhooks
Receive real-time notifications about events
Webhooks allow you to receive real-time notifications about events in your Fanbeam workspace.
Supported Events
post.published- A post was successfully publishedpost.failed- A post failed to publish
Note:
channel.disconnectedandanalytics.updatedevents are planned for future releases.
Setting Up Webhooks
- Navigate to Settings → Webhooks
- Click Add Webhook
- Enter your webhook URL
- Select the events you want to receive
- Save the webhook
Webhook Payload
All webhook payloads follow this structure:
{
"event": "post.published",
"timestamp": "2024-01-15T10:30:00Z",
"data": {
"postId": "post_123",
"channelId": "channel_456",
"platform": "instagram"
}
}Event Types
post.published
Triggered when a post is successfully published to a platform.
{
"event": "post.published",
"timestamp": "2024-01-15T10:30:00Z",
"data": {
"postId": "post_123",
"channelId": "channel_456",
"platform": "instagram",
"publishedAt": "2024-01-15T10:30:00Z",
"url": "https://instagram.com/p/abc123"
}
}post.failed
Triggered when a post fails to publish.
{
"event": "post.failed",
"timestamp": "2024-01-15T10:30:00Z",
"data": {
"postId": "post_123",
"channelId": "channel_456",
"error": "Rate limit exceeded"
}
}Webhook Security
Webhooks are signed using HMAC-SHA256. Verify the signature to ensure the webhook is from Fanbeam:
import crypto from 'crypto';
function verifyWebhook(payload: string, signature: string, secret: string): boolean {
const hmac = crypto.createHmac('sha256', secret);
const digest = hmac.update(payload).digest('hex');
return crypto.timingSafeEqual(
Buffer.from(signature),
Buffer.from(digest)
);
}
// Usage
const isValid = verifyWebhook(req.body, req.headers['x-fanbeam-signature'], webhookSecret);Retry Logic
If your webhook endpoint returns a non-2xx status code, Fanbeam will retry:
- Max retries: 3 attempts
- Retry strategy: Exponential backoff (30s, 60s, 120s visibility timeout)
- Failed deliveries are logged in the delivery history
Testing Webhooks
Use the webhook testing tool in the dashboard:
- Navigate to Settings → Webhooks
- Click Test on a webhook
- Select an event type
- Send a test webhook