Skip to main content

Subscription Sync Webhook

Receive notifications when subscription status changes in edrone.

Webhook URL

Configure your webhook endpoint in Mission Control: SettingsIntegrationsWebhooks

Payload

{
"event": "subscription_status_changed",
"timestamp": "2024-01-15T10:30:00Z",
"data": {
"email": "customer@example.com",
"subscriber_status": 0,
"sms_subscriber_status": 1,
"reason": "unsubscribed_by_user"
}
}

Fields

FieldTypeDescription
eventstringEvent type
timestampstringISO 8601 timestamp
data.emailstringCustomer email
data.subscriber_statusnumber1 = subscribed, 0 = unsubscribed
data.sms_subscriber_statusnumberSMS subscription status
data.reasonstringReason for change

Handling the webhook

const express = require('express');
const app = express();

app.use(express.json());

app.post('/webhooks/edrone', (req, res) => {
const payload = req.body;

if (payload.event === 'subscription_status_changed') {
const email = payload.data.email;
const subscribed = payload.data.subscriber_status === 1;

// Update your database
updateSubscriptionStatus(email, subscribed);
}

res.json({ received: true });
});

app.listen(3000);

Security

Verify webhook authenticity:

  1. Check request comes from edrone IP range
  2. Validate payload structure
  3. Use HTTPS endpoint only

Retry policy

Failed webhooks are retried:

  • 1st retry: 1 minute
  • 2nd retry: 5 minutes
  • 3rd retry: 30 minutes
  • After 3 failures: webhook marked as failed