Webhooks
StorePilot can send an HTTP POST request to any URL when a new error is captured or a new lead is submitted. This allows you to integrate with any external system.
Configuration
Configure webhook URLs per-site in Dashboard → Sites → [Site] → Settings:
| Setting Key | Trigger |
|---|---|
n8n_webhook | New error (first occurrence or re-open) |
n8n_leads_webhook | New lead capture |
Although the setting keys reference n8n, you can point them to any webhook receiver — Zapier, Make, your own server, etc.
Payload: Error Webhook
Sent to n8n_webhook URL when a new error fires.
{
"event": "new_error",
"siteId": 1,
"siteDomain": "mystore.com",
"error": {
"id": 42,
"message": "Uncaught TypeError: Cannot read properties of null",
"source": "https://mystore.com/wp-content/themes/my-theme/js/app.js",
"lineno": 42,
"colno": 18,
"stack": "TypeError: ...",
"status": "new",
"occurrenceCount": 1,
"firstSeenAt": "2024-01-15T10:00:00.000Z",
"lastSeenAt": "2024-01-15T10:00:00.000Z",
"context": {
"url": "https://mystore.com/shop/",
"userAgent": "Mozilla/5.0 ...",
"referrer": ""
}
}
}
Payload: Lead Webhook
Sent to n8n_leads_webhook URL when a new lead is captured.
{
"event": "new_lead",
"siteId": 1,
"siteDomain": "mystore.com",
"lead": {
"id": 17,
"firstName": "Jane",
"lastName": "Smith",
"email": "jane@example.com",
"phone": "+380501234567",
"wpUserId": 5,
"cartItems": [
{
"product_id": 123,
"name": "Premium Widget",
"qty": 2,
"line_total": 49.98
}
],
"cartTotal": "$49.98",
"pageUrl": "https://mystore.com/checkout/",
"capturedAt": "2024-01-15T10:05:00.000Z"
}
}
n8n Integration Example
- In n8n, create a new workflow
- Add a Webhook trigger node
- Copy the webhook URL from n8n
- Paste it into the Platform settings (
n8n_webhookorn8n_leads_webhook) - Connect downstream nodes to:
- Send a Slack message
- Create a Jira ticket
- Add a row to Google Sheets
- Send a WhatsApp message
- Create a CRM contact
Webhook Security
Webhook payloads are sent without a signature by default. If you need to verify that a webhook comes from your Platform:
- Add a secret token to your webhook URL as a query parameter:
?secret=your-secret - Validate it in your receiver
A future version may add HMAC-SHA256 header signatures.
Retry Behaviour
Webhook delivery is fire and forget — if the target URL is unavailable, the notification is not retried. For reliable delivery, use n8n's built-in retry mechanism or point the webhook to a queue.