Receive real-time notifications when events happen in your SMSly account.
Receive notifications within milliseconds of events occurring.
Verify webhook authenticity with HMAC-SHA256 signatures.
Failed deliveries are automatically retried with exponential backoff.
Subscribe only to the events you care about.
Go to your Dashboard → Settings → Webhooks and add your endpoint URL.
https://your-app.com/webhooks/smslyChoose which events you want to receive notifications for.
// 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 });
});