Webhooks Documentation

Real-Time Webhooks

Receive real-time notifications when events happen in your SMSly account.

Real-Time Events

Receive notifications within milliseconds of events occurring.

Signature Verification

Verify webhook authenticity with HMAC-SHA256 signatures.

Automatic Retries

Failed deliveries are automatically retried with exponential backoff.

Event Filtering

Subscribe only to the events you care about.

Getting Started

1Configure Your Webhook Endpoint

Go to your Dashboard → Settings → Webhooks and add your endpoint URL.

https://your-app.com/webhooks/smsly

2Select Events to Subscribe

Choose which events you want to receive notifications for.

3Handle Webhook Events

// Webhook handler example (Node.js/Express)
const crypto = require('crypto');

app.post('/webhooks/smsly', (req, res) => {
  const signature = req.headers['x-smsly-signature'];
  const payload = JSON.stringify(req.body);
  
  // Verify signature
  const expectedSignature = crypto
    .createHmac('sha256', process.env.WEBHOOK_SECRET)
    .update(payload)
    .digest('hex');
  
  if (signature !== expectedSignature) {
    return res.status(401).json({ error: 'Invalid signature' });
  }
  
  // Handle the event
  const { event, data } = req.body;
  
  switch (event) {
    case 'message.delivered':
      console.log('Message delivered:', data.message_id);
      break;
    case 'message.failed':
      console.log('Message failed:', data.error);
      break;
  }
  
  res.status(200).json({ received: true });
});

Webhook Events

Event
Description
message.sent
Triggered when a message is successfully sent
message.delivered
Triggered when a message is delivered to the recipient
message.failed
Triggered when a message fails to deliver
message.received
Triggered when an inbound message is received
otp.verified
Triggered when an OTP is successfully verified
call.initiated
Triggered when a voice call is initiated
call.completed
Triggered when a voice call ends

Start Using Webhooks

Set up real-time notifications in minutes.