CDP User Events
Customer Data Platform user events: identify, register, login, logout, subscribe and unsubscribe.
CDP (Customer Data Platform) user events, aligned with the Segmentify Integration SDK (@segmentify/integration).
Endpoint
Section titled “Endpoint”POST {baseUrl}/add/events/v1.json?apiKey={apiKey}Base URL per region
Section titled “Base URL per region”| Region | baseUrl |
|---|---|
| QA | https://gandalf-qa.segmentify.com |
| TR | https://per2.segmentify.com |
| EU | https://gandalf-eu.segmentify.com |
| LATAM | https://gandalf-br.segmentify.com |
General notes
Section titled “General notes”-
Every event has the shape
name+properties. -
The SDK adds the context fields automatically on
sendEvent(device,userId,sessionId,currency,lang,sdkVersionand so on). The example bodies on this page include them. -
Profile events (
IdentifyUser,RegisterUser,LoginUser,LogoutUser) are not sent with emptyproperties. -
If at least one consent field is present, the SDK fills the missing consent fields with
NOT_SET.
SDK method → event name
Section titled “SDK method → event name”| SDK method | Event name |
|---|---|
IdentifyUser |
USER_IDENTIFY |
RegisterUser |
USER_REGISTER |
LoginUser |
USER_LOGIN |
LogoutUser |
USER_LOGOUT |
SubscribeUser |
USER_SUBSCRIBE |
UnsubscribeUser |
USER_UNSUBSCRIBE |
Profile Events
Section titled “Profile Events”Profile events, which share the CdpEventsPayload type.
CdpEventsPayload fields
Section titled “CdpEventsPayload fields”| Field | Type | Required | Description |
|---|---|---|---|
phone |
string | No | Phone number |
email |
string | No | Email address |
username |
string | No | Username |
source |
string | No | Source (for example email-collection) |
gender |
string | No | Gender |
fullName |
string | No | Full name |
callConsent |
enum | No | SUBSCRIBED | UNSUBSCRIBED | NOT_SET |
emailConsent |
enum | No | SUBSCRIBED | UNSUBSCRIBED | NOT_SET |
whatsappConsent |
enum | No | SUBSCRIBED | UNSUBSCRIBED | NOT_SET |
smsConsent |
enum | No | SUBSCRIBED | UNSUBSCRIBED | NOT_SET |
| (extra key) | string | number | boolean | No | Custom trait (for example loyalty_level) |
Consent behavior
Section titled “Consent behavior”- If
propertiesis empty, the event is not sent. - If at least one consent field is present, the missing consent fields are set to
NOT_SET. - If no consent field is present, the payload is sent as it is.
Identify User
Section titled “Identify User”IdentifyUser → USER_IDENTIFY
Section titled “IdentifyUser → USER_IDENTIFY”Sends a snapshot of the user’s identity and traits when the profile changes. If the profile has not changed, the SDK skips the event (deduplication).
SDK method
Section titled “SDK method”await segmentify.Events.IdentifyUser(params: CdpEventsPayload)Behavior notes
Section titled “Behavior notes”-
Consent defaults are applied (
withConsentDefaults). -
An empty payload is not sent.
-
A profile identical to the last one sent successfully is not sent again (deduplication).
-
After a successful send the profile snapshot is stored; on an error the in-flight reservation is cleared.
properties parameters
Section titled “properties parameters”| Parameter | Type | Required | Enum / Example | Description |
|---|---|---|---|---|
email |
string | No | user@example.com |
|
phone |
string | No | 905551234567 |
Phone (phone, not phoneNumber) |
username |
string | No | johndoe |
Username |
fullName |
string | No | John Doe |
Full name |
gender |
string | No | male |
Gender |
source |
string | No | email-collection |
Data source |
callConsent |
string | No | SUBSCRIBED | UNSUBSCRIBED | NOT_SET |
Call consent |
emailConsent |
string | No | SUBSCRIBED | UNSUBSCRIBED | NOT_SET |
Email consent |
whatsappConsent |
string | No | SUBSCRIBED | UNSUBSCRIBED | NOT_SET |
WhatsApp consent |
smsConsent |
string | No | SUBSCRIBED | UNSUBSCRIBED | NOT_SET |
SMS consent |
| (extra) | string/number/boolean | No | loyalty_level: "gold" |
Free-form trait fields |
Context fields (added automatically by the SDK)
Section titled “Context fields (added automatically by the SDK)”| Field | Type | Description |
|---|---|---|
device |
string | PC | mobile | tablet |
userId |
string | Segmentify user ID |
sessionId |
string | Session ID |
referrer |
string | Referrer URL |
pageUrl |
string | Page URL |
userAgent |
string | User-Agent |
currency |
string | Currency |
lang |
string | Language |
sdkVersion |
string | SDK version |
os / osversion |
string | Operating system |
browser |
string | Browser |
dnp |
string | Do-not-personalize |
testMode |
string | Test mode |
region |
string | Optional region |
Example body
{ "name": "USER_IDENTIFY", "properties": { "email": "user@example.com", "username": "johndoe", "phone": "905551234567", "gender": "male", "callConsent": "SUBSCRIBED", "emailConsent": "UNSUBSCRIBED", "whatsappConsent": "NOT_SET", "smsConsent": "SUBSCRIBED", "source": "email-collection", "fullName": "John Doe", "loyalty_level": "gold" }, "device": "mobile", "userId": "1234567890123456789", "sessionId": "9876543210987654321", "referrer": "", "pageUrl": "https://www.example.com/account", "userAgent": "Mozilla/5.0", "currency": "EUR", "lang": "EN", "sdkVersion": "1.0.0", "os": "Android", "osversion": "14", "browser": "Chrome", "dnp": "false", "testMode": "false"}Traits User
Section titled “Traits User”Sends the USER_TRAITS event with the user’s profile properties and segments. The properties object takes the same fields as Identify User.
Example body
{ "name": "USER_TRAITS", "properties": { "email": "user@example.com", "username": "johndoe", "phone": "905551234567", "gender": "male", "callConsent": "SUBSCRIBED", "emailConsent": "UNSUBSCRIBED", "whatsappConsent": "NOT_SET", "smsConsent": "SUBSCRIBED", "source": "email-collection", "fullName": "John Doe", "loyalty_level": "gold", "segments": [ "vip-customers" ] }, "segments": [ "vip-customers" ], "device": "mobile", "userId": "1234567890123456789", "sessionId": "9876543210987654321", "referrer": "", "pageUrl": "https://www.example.com/account", "userAgent": "Mozilla/5.0", "currency": "EUR", "lang": "EN", "sdkVersion": "1.0.0", "os": "Android", "osversion": "14", "browser": "Chrome", "dnp": "false", "testMode": "false"}Register User
Section titled “Register User”RegisterUser → USER_REGISTER
Section titled “RegisterUser → USER_REGISTER”Sent when a user completes registration (signup). It creates the CDP profile and is separate from the older USER_OPERATIONS / signup event.
SDK method
Section titled “SDK method”await segmentify.Events.RegisterUser(params: CdpEventsPayload)Behavior notes
Section titled “Behavior notes”- Consent defaults are applied.
- An empty payload is not sent.
- No deduplication: it is sent on every call (unlike IdentifyUser).
properties parameters
Section titled “properties parameters”| Parameter | Type | Required | Enum / Example | Description |
|---|---|---|---|---|
email |
string | No | user@example.com |
|
phone |
string | No | 905551234567 |
Phone |
username |
string | No | johndoe |
Username |
fullName |
string | No | John Doe |
Full name |
gender |
string | No | male |
Gender |
source |
string | No | email-collection |
Data source |
callConsent |
string | No | SUBSCRIBED | UNSUBSCRIBED | NOT_SET |
Call consent |
emailConsent |
string | No | SUBSCRIBED | UNSUBSCRIBED | NOT_SET |
Email consent |
whatsappConsent |
string | No | SUBSCRIBED | UNSUBSCRIBED | NOT_SET |
WhatsApp consent |
smsConsent |
string | No | SUBSCRIBED | UNSUBSCRIBED | NOT_SET |
SMS consent |
| (extra) | string/number/boolean | No | loyalty_level: "gold" |
Free-form trait fields |
Example body
{ "name": "USER_REGISTER", "properties": { "email": "user@example.com", "username": "johndoe", "phone": "905551234567", "gender": "male", "callConsent": "SUBSCRIBED", "emailConsent": "UNSUBSCRIBED", "whatsappConsent": "NOT_SET", "smsConsent": "SUBSCRIBED", "source": "email-collection", "fullName": "John Doe", "loyalty_level": "gold" }, "device": "mobile", "userId": "1234567890123456789", "sessionId": "9876543210987654321", "referrer": "", "pageUrl": "https://www.example.com/register", "userAgent": "Mozilla/5.0", "currency": "EUR", "lang": "EN", "sdkVersion": "1.0.0", "os": "Android", "osversion": "14", "browser": "Chrome", "dnp": "false", "testMode": "false"}Login User
Section titled “Login User”LoginUser → USER_LOGIN
Section titled “LoginUser → USER_LOGIN”Sent when a user logs in. Typically email (or another identifying field) is enough.
SDK method
Section titled “SDK method”await segmentify.Events.LoginUser(params: CdpEventsPayload)Behavior notes
Section titled “Behavior notes”- Consent defaults are applied.
- An empty payload is not sent.
- No deduplication.
properties parameters
Section titled “properties parameters”| Parameter | Type | Required | Enum / Example | Description |
|---|---|---|---|---|
email |
string | No* | user@example.com |
Email (*recommended in practice) |
phone |
string | No | 905551234567 |
Phone |
username |
string | No | johndoe |
Username |
fullName |
string | No | John Doe |
Full name |
gender |
string | No | male |
Gender |
source |
string | No | login-form |
Data source |
callConsent |
string | No | SUBSCRIBED | UNSUBSCRIBED | NOT_SET |
Call consent |
emailConsent |
string | No | SUBSCRIBED | UNSUBSCRIBED | NOT_SET |
Email consent |
whatsappConsent |
string | No | SUBSCRIBED | UNSUBSCRIBED | NOT_SET |
WhatsApp consent |
smsConsent |
string | No | SUBSCRIBED | UNSUBSCRIBED | NOT_SET |
SMS consent |
| (extra) | string/number/boolean | No | — | Free-form trait fields |
Example body
{ "name": "USER_LOGIN", "properties": { "email": "user@example.com" }, "device": "mobile", "userId": "1234567890123456789", "sessionId": "9876543210987654321", "referrer": "", "pageUrl": "https://www.example.com/login", "userAgent": "Mozilla/5.0", "currency": "EUR", "lang": "EN", "sdkVersion": "1.0.0", "os": "Android", "osversion": "14", "browser": "Chrome", "dnp": "false", "testMode": "false"}Logout User
Section titled “Logout User”LogoutUser → USER_LOGOUT
Section titled “LogoutUser → USER_LOGOUT”Sent when a user logs out.
SDK method
Section titled “SDK method”await segmentify.Events.LogoutUser(params: CdpEventsPayload)Behavior notes
Section titled “Behavior notes”- Consent defaults are applied.
- An empty payload is not sent.
- No deduplication.
properties parameters
Section titled “properties parameters”| Parameter | Type | Required | Enum / Example | Description |
|---|---|---|---|---|
email |
string | No* | user@example.com |
Email (*recommended in practice) |
phone |
string | No | 905551234567 |
Phone |
username |
string | No | johndoe |
Username |
fullName |
string | No | John Doe |
Full name |
gender |
string | No | male |
Gender |
source |
string | No | logout |
Data source |
callConsent |
string | No | SUBSCRIBED | UNSUBSCRIBED | NOT_SET |
Call consent |
emailConsent |
string | No | SUBSCRIBED | UNSUBSCRIBED | NOT_SET |
Email consent |
whatsappConsent |
string | No | SUBSCRIBED | UNSUBSCRIBED | NOT_SET |
WhatsApp consent |
smsConsent |
string | No | SUBSCRIBED | UNSUBSCRIBED | NOT_SET |
SMS consent |
| (extra) | string/number/boolean | No | — | Free-form trait fields |
Example body
{ "name": "USER_LOGOUT", "properties": { "email": "user@example.com" }, "device": "mobile", "userId": "1234567890123456789", "sessionId": "9876543210987654321", "referrer": "", "pageUrl": "https://www.example.com/logout", "userAgent": "Mozilla/5.0", "currency": "EUR", "lang": "EN", "sdkVersion": "1.0.0", "os": "Android", "osversion": "14", "browser": "Chrome", "dnp": "false", "testMode": "false"}Channel Subscription
Section titled “Channel Subscription”Channel subscribe and unsubscribe events.
The channel field is the discriminator: the required fields depend on the channel.
Channel enum
Section titled “Channel enum”| Value | Description |
|---|---|
web_push |
Web Push / FCM |
email |
|
whatsapp |
|
sms |
SMS |
call |
Call |
Purpose enum (email only)
Section titled “Purpose enum (email only)”MARKETING | TRANSACTIONAL | PERSONALISATION | ALL
Required fields for subscribe
Section titled “Required fields for subscribe”| channel | Required fields |
|---|---|
web_push |
pushSubscriptionId, auth, p256dh, fcmToken, endPoint |
email |
email, purpose[] |
whatsapp / sms / call |
phone |
Required fields for unsubscribe
Section titled “Required fields for unsubscribe”| channel | Required fields |
|---|---|
web_push |
channel only |
email |
channel, email (+ optional purpose[]) |
whatsapp / sms / call |
channel, phone |
Field name: the phone field must be phone (not phoneNumber).
Subscribe — Web Push
Section titled “Subscribe — Web Push”SubscribeUser → USER_SUBSCRIBE (channel: web_push)
Section titled “SubscribeUser → USER_SUBSCRIBE (channel: web_push)”Sent when a user subscribes to the Web Push / FCM channel.
SDK method
Section titled “SDK method”await segmentify.Events.SubscribeUser({ channel: 'web_push', pushSubscriptionId: '...', auth: '...', p256dh: '...', fcmToken: '...', endPoint: '...'})properties parameters
Section titled “properties parameters”| Parameter | Type | Required | Description |
|---|---|---|---|
channel |
string | Yes | Fixed: web_push |
pushSubscriptionId |
string | Yes | Push subscription ID |
auth |
string | Yes | Push auth key |
p256dh |
string | Yes | Push p256dh key |
fcmToken |
string | Yes | FCM token |
endPoint |
string | Yes | Push endpoint URL |
Example body
{ "name": "USER_SUBSCRIBE", "properties": { "channel": "web_push", "pushSubscriptionId": "fcm_token_abc123_xyz", "auth": "auth_token_example", "p256dh": "p256dh_key_example", "fcmToken": "fcm_token_example", "endPoint": "https://fcm.googleapis.com/fcm/send/example" }, "device": "mobile", "userId": "1234567890123456789", "sessionId": "9876543210987654321", "currency": "EUR", "lang": "EN", "sdkVersion": "1.0.0"}Subscribe — Email
Section titled “Subscribe — Email”SubscribeUser → USER_SUBSCRIBE (channel: email)
Section titled “SubscribeUser → USER_SUBSCRIBE (channel: email)”Sent when a user subscribes to the email channel.
SDK method
Section titled “SDK method”await segmentify.Events.SubscribeUser({ channel: 'email', email: 'test@email.com', purpose: ['MARKETING']})properties parameters
Section titled “properties parameters”| Parameter | Type | Required | Enum / Example | Description |
|---|---|---|---|---|
channel |
string | Yes | email |
Channel |
email |
string | Yes | test@email.com |
Subscriber email |
purpose |
string[] | Yes | MARKETING | TRANSACTIONAL | PERSONALISATION | ALL |
List of purposes (JSON array) |
Note: purpose must be an array, not a single string.
Example body
{ "name": "USER_SUBSCRIBE", "properties": { "channel": "email", "email": "user@example.com", "purpose": [ "MARKETING" ], "doNotSendWelcomeEmail": false }, "device": "mobile", "userId": "1234567890123456789", "sessionId": "9876543210987654321", "currency": "EUR", "lang": "EN", "sdkVersion": "1.0.0"}Subscribe — WhatsApp
Section titled “Subscribe — WhatsApp”SubscribeUser → USER_SUBSCRIBE (channel: whatsapp)
Section titled “SubscribeUser → USER_SUBSCRIBE (channel: whatsapp)”Sent when a user subscribes to the WhatsApp channel.
SDK method
Section titled “SDK method”await segmentify.Events.SubscribeUser({ channel: 'whatsapp', phone: '905551234567'})properties parameters
Section titled “properties parameters”| Parameter | Type | Required | Description |
|---|---|---|---|
channel |
string | Yes | Fixed: whatsapp |
phone |
string | Yes | Phone number (phone, not phoneNumber) |
Example body
{ "name": "USER_SUBSCRIBE", "properties": { "channel": "whatsapp", "phone": "905551234567" }, "device": "mobile", "userId": "1234567890123456789", "sessionId": "9876543210987654321", "currency": "EUR", "lang": "EN", "sdkVersion": "1.0.0"}Subscribe — SMS
Section titled “Subscribe — SMS”SubscribeUser → USER_SUBSCRIBE (channel: sms)
Section titled “SubscribeUser → USER_SUBSCRIBE (channel: sms)”Sent when a user subscribes to the SMS channel.
SDK method
Section titled “SDK method”await segmentify.Events.SubscribeUser({ channel: 'sms', phone: '905551234567'})properties parameters
Section titled “properties parameters”| Parameter | Type | Required | Description |
|---|---|---|---|
channel |
string | Yes | Fixed: sms |
phone |
string | Yes | Phone number |
Example body
{ "name": "USER_SUBSCRIBE", "properties": { "channel": "sms", "phone": "905551234567" }, "device": "mobile", "userId": "1234567890123456789", "sessionId": "9876543210987654321", "currency": "EUR", "lang": "EN", "sdkVersion": "1.0.0"}Subscribe — Call
Section titled “Subscribe — Call”SubscribeUser → USER_SUBSCRIBE (channel: call)
Section titled “SubscribeUser → USER_SUBSCRIBE (channel: call)”Sent when a user subscribes to the call channel.
SDK method
Section titled “SDK method”await segmentify.Events.SubscribeUser({ channel: 'call', phone: '905551234567'})properties parameters
Section titled “properties parameters”| Parameter | Type | Required | Description |
|---|---|---|---|
channel |
string | Yes | Fixed: call |
phone |
string | Yes | Phone number |
Example body
{ "name": "USER_SUBSCRIBE", "properties": { "channel": "call", "phone": "905551234567" }, "device": "mobile", "userId": "1234567890123456789", "sessionId": "9876543210987654321", "currency": "EUR", "lang": "EN", "sdkVersion": "1.0.0"}Unsubscribe — Web Push
Section titled “Unsubscribe — Web Push”UnsubscribeUser → USER_UNSUBSCRIBE (channel: web_push)
Section titled “UnsubscribeUser → USER_UNSUBSCRIBE (channel: web_push)”Sent when a user cancels the Web Push subscription. Only channel is needed.
SDK method
Section titled “SDK method”await segmentify.Events.UnsubscribeUser({ channel: 'web_push' })properties parameters
Section titled “properties parameters”| Parameter | Type | Required | Description |
|---|---|---|---|
channel |
string | Yes | Fixed: web_push |
email |
string | No | Not used for this channel |
phone |
string | No | Not used for this channel |
purpose |
string[] | No | Not used for this channel |
Example body
{ "name": "USER_UNSUBSCRIBE", "properties": { "channel": "web_push" }, "device": "mobile", "userId": "1234567890123456789", "sessionId": "9876543210987654321", "currency": "EUR", "lang": "EN", "sdkVersion": "1.0.0"}Unsubscribe — Email
Section titled “Unsubscribe — Email”UnsubscribeUser → USER_UNSUBSCRIBE (channel: email)
Section titled “UnsubscribeUser → USER_UNSUBSCRIBE (channel: email)”Sent when a user cancels the email subscription.
SDK method
Section titled “SDK method”await segmentify.Events.UnsubscribeUser({ channel: 'email', email: 'test@email.com', purpose: ['MARKETING'] // optional})properties parameters
Section titled “properties parameters”| Parameter | Type | Required | Enum / Example | Description |
|---|---|---|---|---|
channel |
string | Yes | email |
Channel |
email |
string | Yes | Email address being unsubscribed | |
purpose |
string[] | No | MARKETING | TRANSACTIONAL | PERSONALISATION | ALL |
Purpose(s) being cancelled |
phone |
string | No | — | Not used for this channel |
Example body
{ "name": "USER_UNSUBSCRIBE", "properties": { "channel": "email", "email": "user@example.com", "purpose": [ "MARKETING" ] }, "device": "mobile", "userId": "1234567890123456789", "sessionId": "9876543210987654321", "currency": "EUR", "lang": "EN", "sdkVersion": "1.0.0"}Unsubscribe — WhatsApp
Section titled “Unsubscribe — WhatsApp”UnsubscribeUser → USER_UNSUBSCRIBE (channel: whatsapp)
Section titled “UnsubscribeUser → USER_UNSUBSCRIBE (channel: whatsapp)”Sent when a user cancels the WhatsApp subscription.
SDK method
Section titled “SDK method”await segmentify.Events.UnsubscribeUser({ channel: 'whatsapp', phone: '905551234567'})properties parameters
Section titled “properties parameters”| Parameter | Type | Required | Description |
|---|---|---|---|
channel |
string | Yes | Fixed: whatsapp |
phone |
string | Yes | Phone number |
Example body
{ "name": "USER_UNSUBSCRIBE", "properties": { "channel": "whatsapp", "phone": "905551234567" }, "device": "mobile", "userId": "1234567890123456789", "sessionId": "9876543210987654321", "currency": "EUR", "lang": "EN", "sdkVersion": "1.0.0"}Unsubscribe — SMS
Section titled “Unsubscribe — SMS”UnsubscribeUser → USER_UNSUBSCRIBE (channel: sms)
Section titled “UnsubscribeUser → USER_UNSUBSCRIBE (channel: sms)”Sent when a user cancels the SMS subscription.
SDK method
Section titled “SDK method”await segmentify.Events.UnsubscribeUser({ channel: 'sms', phone: '905551234567'})properties parameters
Section titled “properties parameters”| Parameter | Type | Required | Description |
|---|---|---|---|
channel |
string | Yes | Fixed: sms |
phone |
string | Yes | Phone number |
Example body
{ "name": "USER_UNSUBSCRIBE", "properties": { "channel": "sms", "phone": "905551234567" }, "device": "mobile", "userId": "1234567890123456789", "sessionId": "9876543210987654321", "currency": "EUR", "lang": "EN", "sdkVersion": "1.0.0"}Unsubscribe — Call
Section titled “Unsubscribe — Call”UnsubscribeUser → USER_UNSUBSCRIBE (channel: call)
Section titled “UnsubscribeUser → USER_UNSUBSCRIBE (channel: call)”Sent when a user cancels the call subscription.
SDK method
Section titled “SDK method”await segmentify.Events.UnsubscribeUser({ channel: 'call', phone: '905551234567'})properties parameters
Section titled “properties parameters”| Parameter | Type | Required | Description |
|---|---|---|---|
channel |
string | Yes | Fixed: call |
phone |
string | Yes | Phone number |
Example body
{ "name": "USER_UNSUBSCRIBE", "properties": { "channel": "call", "phone": "905551234567" }, "device": "mobile", "userId": "1234567890123456789", "sessionId": "9876543210987654321", "currency": "EUR", "lang": "EN", "sdkVersion": "1.0.0"}