Back to docs
Webhooks
Webhooks
Receive real-time notifications when conversion events happen
How Webhooks Work
PerfectConvertly sends HTTP POST requests to your configured endpoint
- Configure your webhook endpoint URL in the dashboard
- Select which events you want to subscribe to
- When an event occurs, we send a POST request to your URL
- Verify the request signature using your webhook secret
- Respond with a 200 status code to acknowledge receipt
Available Events
conversion.completedFired when a conversion finishes successfullyconversion.failedFired when a conversion failscredits.lowFired when your credit balance drops below 5subscription.updatedFired when your subscription changesWebhook Payload Example
Example payload for conversion.completed event
{
"event": "conversion.completed",
"timestamp": "2024-01-15T10:30:00Z",
"data": {
"conversion_id": "conv_abc123",
"status": "completed",
"transactions_count": 47,
"output_format": "csv",
"output_url": "https://..."
},
"signature": "sha256=..."
}Verifying Signatures
Verify that the webhook came from PerfectConvertly
import crypto from 'crypto';
function verifyWebhook(payload, signature, secret) {
const expected = crypto
.createHmac('sha256', secret)
.update(JSON.stringify(payload))
.digest('hex');
return 'sha256=' + expected === signature;
}