New: Unified API Platform - 250+ Endpoints, One Integration, Infinite PossibilitiesExplore Now ?
Back to Documentation

Webhooks Documentation

Real-time Event Notifications

Stay updated with webhook events

Webhooks allow your application to receive real-time notifications when specific events occur in OnlyOneAPI.

Setting Up Webhooks

// 1. Configure webhook endpoint in your app
app.post('/webhooks/onlyoneapi', (req, res) => {
 const signature = req.headers['x-onlyoneapi-signature'];
 const event = req.body;
 
 // Verify webhook signature
 if (!verifyWebhookSignature(signature, req.body)) {
  return res.status(401).send('Invalid signature');
 }
 
 // Handle different event types
 switch(event.type) {
  case 'invoice.paid':
   handleInvoicePaid(event.data);
   break;
  case 'api.limit.reached':
   handleApiLimitReached(event.data);
   break;
  // ... handle other events
 }
 
 res.status(200).send('OK');
});

Available Events

  • invoice.created - New invoice generated
  • invoice.paid - Invoice payment received
  • api.limit.reached - API rate limit reached
  • task.completed - Async task finished
  • batch.processed - Batch job completed

Security

All webhooks are signed with HMAC-SHA256. Always verify the signature to ensure the webhook is from OnlyOneAPI.