Webhooks
Flashy has two ways to send webhooks to a third-party application:
- Account webhooks — every matching action that happens on the account triggers the webhook.
- Automation webhooks — you add a webhook as an action step inside an automation.
Deliveries are sent as a POST request to your endpoint with a JSON array of one or more event objects. Respond with any 2xx status to acknowledge receipt.
Managing webhooks via the API
Create a webhook by giving us your endpoint and the events to monitor:
curl -X POST https://api.flashy.app/webhook \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"endpoint": "https://mydomain.com/webhooks/flashy",
"events": ["contact_created", "purchase"]
}'
See the API Reference for listing (GET /webhooks), available events (GET /webhooks/list), updating (PUT /webhook) and deleting (DELETE /webhook).
Account webhook events
Below is every account-level event and the payload your endpoint receives.
page_view
[
{
"page_url": "https://example.com/?email=name@email.com",
"page_title": "woocommerce – Just another WordPress site",
"timezone": "Asia/Jerusalem",
"referral": "",
"utm": { "campaign": null, "source": null, "medium": null, "term": null, "content": null },
"gclid": null,
"cid": null,
"account_id": 246,
"first_visit": 1674573460,
"session_count": 4,
"timestamp": 1674573859,
"anonymous_id": "246:3deb8de9123544d010b690a3a1a637",
"flsid": null,
"contact_id": "ab734a688a56c24863e5d8313b80892b",
"event": "page_view"
}
]
add_to_cart
[
{
"value": "20",
"content_ids": [65],
"currency": "USD",
"timestamp": 1674654971,
"account_id": 246,
"anonymous_id": "246:ba4bb952a996d670671a3b749e17be",
"flsid": null,
"contact_id": "c3b0b4e1eb2128776a06e7e5b9ae630e",
"event": "add_to_cart"
}
]
contact_created
[
{
"account_id": 246,
"contact_id": "7a69527d87e6a3e708d1d4c12e3d45cc",
"created_at": 1674656958,
"event": "contact_created"
}
]
contact_updated
Includes old and new objects with the properties that changed:
[
{
"account_id": 246,
"contact_id": "c3b0b4e1eb2128776a06e7e5b9ae630e",
"old": { "birthday": null },
"new": { "birthday": 1660262400 },
"created_at": 1674655281,
"event": "contact_updated"
}
]
contact_subscribed
[
{
"account_id": 246,
"contact_id": "c3b0b4e1eb2128776a06e7e5b9ae630e",
"feed_id": 219,
"timestamp": 1674573849,
"event": "contact_subscribed"
}
]
contact_unsubscribed
[
{
"account_id": 246,
"contact_id": "c3b0b4e1eb2128776a06e7e5b9ae630e",
"feed_id": 219,
"created_at": 1674655171,
"event": "contact_unsubscribed"
}
]
purchase
The context object carries the full order details from your store integration:
[
{
"account_id": 246,
"contact_id": "c3b0b4e1eb2128776a06e7e5b9ae630e",
"order_id": "449",
"content_ids": [65],
"value": 35,
"status": "processing",
"currency": "USD",
"context": {
"checkout_url": "https://example.com/checkout/order-pay/449/?pay_for_order=true",
"status": "processing",
"items": [
{ "image_link": false, "title": "product", "quantity": 1, "total": "20" }
],
"total": "35.00",
"order_id": 449,
"billing": { "address": "...", "city": "...", "state": null, "postcode": "...", "country": "IL" },
"shipping": { "address": "...", "city": "...", "state": null, "postcode": "...", "country": "IL", "method": "Flat rate", "price": "15" }
},
"delayed": true,
"created_at": 1674657507,
"event": "purchase"
}
]
automation_completed
[
{
"account_id": 246,
"contact_id": "c3b0b4e1eb2128776a06e7e5b9ae630e",
"auto_index": 1,
"automation_id": 477,
"last_step": 1,
"created_at": 1674662051,
"event": "automation_completed"
}
]
email_automation_delivered
[
{
"account_id": 246,
"contact_id": "9d10fa6802776e20138b6bd58cf7cc93",
"auto_index": 0,
"automation_id": 477,
"template_id": 240,
"step_id": 1,
"created_at": 1674662398,
"event": "email_automation_delivered"
}
]
email_automation_opened
[
{
"account_id": 246,
"contact_id": "9d10fa6802776e20138b6bd58cf7cc93",
"automation_id": 477,
"auto_index": 0,
"template_id": 240,
"step_id": "1",
"created_at": 1674662421,
"event": "email_automation_opened"
}
]
email_automation_clicked
[
{
"account_id": 246,
"contact_id": "9d10fa6802776e20138b6bd58cf7cc93",
"automation_id": 477,
"auto_index": 0,
"link": "https://flashy.app/",
"step_id": "1",
"created_at": 1674662428,
"event": "email_automation_clicked"
}
]
email_campaign_bounced
[
{
"account_id": 247,
"contact_id": "87d4495ca059162b42d2ebb9ebea1968",
"campaign_id": 415,
"bounce_type": "soft_bounced",
"created_at": 1675158921,
"event": "email_campaign_bounced"
}
]
incoming_sms
[
{
"account_id": 5125,
"message": "Here will be the content of the text message",
"from": "972526999999",
"to": "972525999999",
"status": "received",
"from_country": "US",
"created_at": 1676727018,
"event": "incoming_sms"
}
]
Automation webhooks
In Flashy you can add a step to an automation that sends a webhook, and pass extra information along with it. The payload includes the full contact object plus the custom JSON you configure on the step:
[
{
"account_id": 97,
"automation_id": 1436,
"auto_index": 0,
"email": "demo_contact@flashyapp.com",
"phone": "",
"contact": {
"lists": [],
"contact_id": "8d474904e2f7e4aa95f36c336a4f546a",
"email": "demo_contact@flashyapp.com",
"created_at": 1710655127,
"first_name": "",
"last_name": "",
"gravatar": "1ce4d141f6d3d432d157e5d53501fc6d",
"primary": "email"
},
"json": "{\n\"any_message\": \"anything you want\"\n}",
"context": [],
"url": "https://webhookendpoint.com",
"event": "webhook"
}
]