Fanbeam
Fanbeam
Documentation
API Reference
AuthenticationOpenAPI SpecificationRate LimitsWebhooks
Getting Started
User Guides
TypeScript SDK
API Reference

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 published
  • post.failed - A post failed to publish

Note: channel.disconnected and analytics.updated events are planned for future releases.

Setting Up Webhooks

  1. Navigate to Settings → Webhooks
  2. Click Add Webhook
  3. Enter your webhook URL
  4. Select the events you want to receive
  5. 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:

  1. Navigate to Settings → Webhooks
  2. Click Test on a webhook
  3. Select an event type
  4. Send a test webhook

Next Steps

  • API Endpoints
  • SDK Documentation

Rate Limits

Understanding API rate limits and best practices

Get Channel

Next Page

On this page

Supported EventsSetting Up WebhooksWebhook PayloadEvent Typespost.publishedpost.failedWebhook SecurityRetry LogicTesting WebhooksNext Steps