Webhooks

Set up webhooks to receive real-time notifications when events occur in your URI Social account.

Available Events

api_key.created

Triggered when a new API key is created

api_key.rotated

Triggered when an API key is rotated

api_key.revoked

Triggered when an API key is revoked

api_key.expired

Triggered when an API key expires

api_key.expiring_soon

Triggered 7 days before an API key expires

rate_limit.exceeded

Triggered when your hourly/daily request rate limit is exceeded

quota.warning

Triggered at 80% of your monthly credit quota

quota.exceeded

Triggered when your monthly credit quota is exceeded

payment.succeeded

Triggered when a subscription payment completes successfully

payment.failed

Triggered when a subscription payment fails

subscription.updated

Triggered when your subscription plan changes

subscription.cancelled

Triggered when your subscription is cancelled

security.suspicious_activity

Triggered when suspicious account activity is detected

security.ip_blocked

Triggered when a request from a non-whitelisted IP is blocked

Creating a Webhook

// Webhooks are managed via the Gateway API directly (not through
// the content-generation SDK client) — or from your dashboard at
// /dashboard/webhooks.
const response = await fetch('https://sdk-gateway.urisocial.com/api/v1/webhooks', {
  method: 'POST',
  headers: {
    'Authorization': `Bearer ${YOUR_SESSION_TOKEN}`,
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    url: 'https://your-app.com/webhooks/urisocial',
    description: 'Production webhook',
    events: ['payment.succeeded', 'quota.warning', 'api_key.revoked']
  })
});

const webhook = await response.json();
console.log('Webhook created:', webhook.id);

Webhook Payload

Example payload structure sent to your webhook endpoint
{
  "id": "665f1a2b3c4d5e6f7a8b9c0d",
  "event": "payment.succeeded",
  "created_at": "2026-05-22T10:30:00Z",
  "data": {
    "transaction_ref": "SDKGTW_abc12345_STARTER_MONTHLY_NGN_1747900200",
    "plan_tier": "starter",
    "billing_interval": "monthly",
    "amount": 75000,
    "currency": "NGN"
  }
}

Verifying Webhooks

Signature Verification
Always verify webhook signatures to ensure authenticity
import crypto from 'crypto';

function verifyWebhookSignature(payload, signature, secret) {
  const hmac = crypto.createHmac('sha256', secret);
  const digest = hmac.update(payload).digest('hex');

  return crypto.timingSafeEqual(
    Buffer.from(signature),
    Buffer.from(digest)
  );
}

// In your webhook endpoint
app.post('/webhooks/urisocial', (req, res) => {
  const signature = req.headers['x-webhook-signature'];
  const payload = JSON.stringify(req.body);

  if (!verifyWebhookSignature(payload, signature, WEBHOOK_SECRET)) {
    return res.status(401).send('Invalid signature');
  }

  // Process webhook
  console.log('Valid webhook:', req.body);
  res.status(200).send('OK');
});

Security Best Practices

  • • Always verify webhook signatures
  • • Use HTTPS for webhook URLs
  • • Store webhook secrets securely
  • • Implement replay attack prevention
  • • Return 200 status quickly to avoid retries

Retry Logic

If your endpoint fails to respond with a 2xx status code, URI Social will retry with exponential backoff:

  • 1
    Retry after 5 minutes
  • 2
    Retry after 30 minutes
  • 3
    Final retry after 2 hours

Testing Webhooks

Send Test Event
Trigger a test webhook to verify your endpoint
curl -X POST https://sdk-gateway.urisocial.com/api/v1/webhooks/{webhook_id}/test \
  -H "Authorization: Bearer YOUR_SESSION_TOKEN"

// Sends a test api_key.created event to verify your endpoint

Ready to Set Up Webhooks?

Start receiving real-time notifications for your social media activities.

Configure Webhooks