Contacts are the foundation of the Flashy platform. You can create them based on any
unique key that you prefer, with email being the default primary key.
We created a list of properties you can use to segment your contacts, and you can always
create custom properties using our dashboard — read more about
Contact Properties.
Send your API key in the x-api-key header.Authentication
// Runs in the visitor's browser once the base pixel is installed — no API key.
// The second argument is an optional list ID to subscribe the contact to.
flashy.contacts.create({
email: 'user1@name.com',
first_name: 'Rafael',
last_name: 'Mor',
}, 159);
// Create or update (the REST `overwrite: true`):
flashy.contacts.createOrUpdate({ email: 'user1@name.com', first_name: 'Rafael' }, 159);
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']);
// create($contact, $primary_key = 'email', $tracking = true, $overwrite = null)
// Pass true as the last argument to update the contact if it already exists.
$flashy->contacts->create([
'email' => 'user1@name.com',
'first_name' => 'Rafael',
'last_name' => 'Mor',
'lists' => ['159' => true, '170' => false],
'birthday' => 1631631569,
], 'email', true, false);
Use your primary key to find a contact — e.g.
GET /contact/user1@name.com?primary_key=email or
GET /contact/1a6711a68d0c381013ab72d3320ba4e5?primary_key=contact_id.
Path parameters
identifierstringrequired
The contact identifier (the value of the primary key, e.g. the email address or contact_id).
Query parameters
primary_keystringdefault: email
The primary key to look the contact up by. Default is email.
Send your API key in the x-api-key header.Authentication
// Updates the contact currently identified in this browser
// (after flashy.contacts.create() or flashy('setCustomer', ...)).
flashy.contacts.update({
last_name: 'Mor',
source: 'Google',
});
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']);
// update($contact, $primary_key = 'email') — the contact array must include
// the primary-key value (here: email) so the SDK knows which contact to update.
$flashy->contacts->update([
'email' => 'user1@name.com',
'last_name' => 'Mor',
'source' => 'Google',
'lists' => ['159' => true],
], 'email');
Mark a contact as blocked whenever you don't want them to receive Flashy emails and
SMS messages. The platform will mark them as unsubscribed on all mailing lists they
are a member of.
The contact can sign up again and the status will change to subscribed based on the
list they signed up for.
Path parameters
identifierstringrequired
The contact identifier (the value of the primary key).
Query parameters
primary_keystringdefault: email
The primary key to look the contact up by. Default is email.
Request
curl -X POST "https://api.flashy.app/contact/user1@name.com/block?primary_key=email" \
-H "x-api-key: YOUR_API_KEY"
Send your API key in the x-api-key header.Authentication