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:
- Navigate to
/platform/config/integrations - Add your webhook endpoint URL
- Copy the signing secret for verification
Event Types ​
| Event | Description |
|---|---|
social_account.connected | New social account connected |
social_account.disconnected | Account was disconnected |
social_account.token_expired | OAuth token needs refresh |
post.published | Post successfully published |
post.failed | Post publishing failed |
post.scheduled | Post was scheduled |
report.ready | Report generation completed |
subscription.updated | Billing 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 ​
- API Reference - Full API documentation
- Admin Configuration - Admin settings