Skip to content

Webhooks ​

Webhooks allow you to subscribe to important events in TendSocial, receiving real-time notifications when actions occur.

Overview ​

TendSocial sends webhook notifications for:

  • Social account events - Account connected, disconnected, token expired
  • Post events - Published, failed, scheduled
  • Analytics events - Report ready, milestone reached
  • Billing events - Subscription changed, payment received

Webhook URL Configuration ​

Configure your webhook endpoint in the Admin Console:

  1. Navigate to /platform/config/integrations
  2. Add your webhook endpoint URL
  3. Copy the signing secret for verification

Event Types ​

EventDescription
social_account.connectedNew social account connected
social_account.disconnectedAccount was disconnected
social_account.token_expiredOAuth token needs refresh
post.publishedPost successfully published
post.failedPost publishing failed
post.scheduledPost was scheduled
report.readyReport generation completed
subscription.updatedBilling subscription changed

Payload Format ​

All webhooks follow this structure:

json
{
  "id": "evt_abc123",
  "type": "post.published",
  "created": "2025-12-15T10:30:00Z",
  "data": {
    "postId": "post_xyz",
    "platform": "twitter",
    "externalId": "1234567890"
  }
}

Signature Verification ​

Webhooks include an X-TendSocial-Signature header for verification:

typescript
import crypto from 'crypto';

function verifyWebhook(payload: string, signature: string, secret: string): boolean {
    const expected = crypto
        .createHmac('sha256', secret)
        .update(payload)
        .digest('hex');
    
    return crypto.timingSafeEqual(
        Buffer.from(signature),
        Buffer.from(`sha256=${expected}`)
    );
}

Delivery & Retries ​

  • Timeout: 30 seconds
  • Retries: 3 attempts with exponential backoff
  • Retry schedule: 1 min, 5 min, 30 min

Webhooks are considered successful with any 2xx response.

Testing Webhooks ​

Use the Admin Console to send test events:

bash
POST /api/admin/webhooks/test
{
  "event": "post.published",
  "url": "https://your-server.com/webhook"
}

See Also ​

TendSocial Documentation