Resource

Events

The Events resource contains endpoints related to the tracking and management of user interactions within our marketing automation platform. Events are pivotal in triggering automations and collecting data about contact activities. These events can be generated both from online and offline interactions, enabling a comprehensive tracking system. Online events typically originate from digital interactions, while offline events are sourced from non-digital or physical world interactions.

Endpoints

Send an event

POST /event

Send events to keep track of your contacts' activity and start automations based on them.

You can read about all the event types we support in the Events guide. There is always an option to use a Custom Event, but we suggest using our pre-defined events when they exist.

Body parameters

  • event string required
    Event name (e.g. ViewContent, AddToCart, Purchase, UpdateCart, CustomEvent).
  • body object required
    Event payload — see the Events guide for the shape of each event type.
Request
curl -X POST "https://api.flashy.app/event" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "event": "ViewContent",
    "body": {
        "email": "contact@company.com",
        "content_ids": [
            "38",
            "789"
        ]
    }
}'
Send your API key in the x-api-key header. Authentication
// The pixel attaches the visitor's identity for you — send the event body only.
flashy('ViewContent', {
    content_ids: ['38', '789']
});
Runs in the visitor’s browser through the website pixel — no API key. Install the pixel
$flashy = new Flashy\Flashy(['api_key' => 'YOUR_API_KEY']);

// track($event, $params) — $params must identify the contact (email, contact_id or flashy_id)
$flashy->events->track('ViewContent', [
    'email' => 'contact@company.com',
    'content_ids' => ['38', '789'],
]);
composer require flashy/flashy-php PHP SDK setup
has no method for this endpoint — showing REST.
Response 200 Event accepted.
{
    "success": true,
    "data": null
}

Send an offline event

POST /event/offline

Send events from offline sources. The main difference here is the fallback on the contact primary key — first we look the contact up by email, and if not found we look by phone. Make sure to send both keys you have, for a better match.

This endpoint is available on the Master plan and above.

Make sure to use the country code if you include a phone number (list of country codes).

Request
curl -X POST "https://api.flashy.app/event/offline" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "event": "Purchase",
    "body": {
        "order_id": "159",
        "value": 150,
        "currency": "USD",
        "phone": "972526845400",
        "email": "contact@company.com",
        "content_ids": [
            "38",
            "789"
        ],
        "channel": "offline",
        "branch": "San Francisco"
    }
}'
Send your API key in the x-api-key header. Authentication
has no method for this endpoint — showing REST.
Response 200 Event accepted.
{
    "success": true,
    "data": null
}