Skip to content

CDP User Events

Customer Data Platform user events: identify, register, login, logout, subscribe and unsubscribe.

View as Markdown llms.txt

CDP (Customer Data Platform) user events, aligned with the Segmentify Integration SDK (@segmentify/integration).

POST {baseUrl}/add/events/v1.json?apiKey={apiKey}
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
  • Every event has the shape name + properties.

  • The SDK adds the context fields automatically on sendEvent (device, userId, sessionId, currency, lang, sdkVersion and so on). The example bodies on this page include them.

  • Profile events (IdentifyUser, RegisterUser, LoginUser, LogoutUser) are not sent with empty properties.

  • If at least one consent field is present, the SDK fills the missing consent fields with NOT_SET.

SDK method Event name
IdentifyUser USER_IDENTIFY
RegisterUser USER_REGISTER
LoginUser USER_LOGIN
LogoutUser USER_LOGOUT
SubscribeUser USER_SUBSCRIBE
UnsubscribeUser USER_UNSUBSCRIBE

Profile events, which share the CdpEventsPayload type.

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)
  1. If properties is empty, the event is not sent.
  2. If at least one consent field is present, the missing consent fields are set to NOT_SET.
  3. If no consent field is present, the payload is sent as it is.

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).

await segmentify.Events.IdentifyUser(params: CdpEventsPayload)
  • 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.

Parameter Type Required Enum / Example Description
email string No user@example.com Email
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"
}

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"
}

Sent when a user completes registration (signup). It creates the CDP profile and is separate from the older USER_OPERATIONS / signup event.

await segmentify.Events.RegisterUser(params: CdpEventsPayload)
  • Consent defaults are applied.
  • An empty payload is not sent.
  • No deduplication: it is sent on every call (unlike IdentifyUser).
Parameter Type Required Enum / Example Description
email string No user@example.com Email
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"
}

Sent when a user logs in. Typically email (or another identifying field) is enough.

await segmentify.Events.LoginUser(params: CdpEventsPayload)
  • Consent defaults are applied.
  • An empty payload is not sent.
  • No deduplication.
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"
}

Sent when a user logs out.

await segmentify.Events.LogoutUser(params: CdpEventsPayload)
  • Consent defaults are applied.
  • An empty payload is not sent.
  • No deduplication.
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 subscribe and unsubscribe events.

The channel field is the discriminator: the required fields depend on the channel.

Value Description
web_push Web Push / FCM
email Email
whatsapp WhatsApp
sms SMS
call Call

MARKETING | TRANSACTIONAL | PERSONALISATION | ALL

channel Required fields
web_push pushSubscriptionId, auth, p256dh, fcmToken, endPoint
email email, purpose[]
whatsapp / sms / call phone
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).

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.

await segmentify.Events.SubscribeUser({
channel: 'web_push',
pushSubscriptionId: '...',
auth: '...',
p256dh: '...',
fcmToken: '...',
endPoint: '...'
})
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"
}

SubscribeUser → USER_SUBSCRIBE (channel: email)

Section titled “SubscribeUser → USER_SUBSCRIBE (channel: email)”

Sent when a user subscribes to the email channel.

await segmentify.Events.SubscribeUser({
channel: 'email',
email: 'test@email.com',
purpose: ['MARKETING']
})
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"
}

SubscribeUser → USER_SUBSCRIBE (channel: whatsapp)

Section titled “SubscribeUser → USER_SUBSCRIBE (channel: whatsapp)”

Sent when a user subscribes to the WhatsApp channel.

await segmentify.Events.SubscribeUser({
channel: 'whatsapp',
phone: '905551234567'
})
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"
}

SubscribeUser → USER_SUBSCRIBE (channel: sms)

Section titled “SubscribeUser → USER_SUBSCRIBE (channel: sms)”

Sent when a user subscribes to the SMS channel.

await segmentify.Events.SubscribeUser({
channel: 'sms',
phone: '905551234567'
})
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"
}

SubscribeUser → USER_SUBSCRIBE (channel: call)

Section titled “SubscribeUser → USER_SUBSCRIBE (channel: call)”

Sent when a user subscribes to the call channel.

await segmentify.Events.SubscribeUser({
channel: 'call',
phone: '905551234567'
})
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"
}

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.

await segmentify.Events.UnsubscribeUser({ channel: 'web_push' })
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"
}

UnsubscribeUser → USER_UNSUBSCRIBE (channel: email)

Section titled “UnsubscribeUser → USER_UNSUBSCRIBE (channel: email)”

Sent when a user cancels the email subscription.

await segmentify.Events.UnsubscribeUser({
channel: 'email',
email: 'test@email.com',
purpose: ['MARKETING'] // optional
})
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"
}

UnsubscribeUser → USER_UNSUBSCRIBE (channel: whatsapp)

Section titled “UnsubscribeUser → USER_UNSUBSCRIBE (channel: whatsapp)”

Sent when a user cancels the WhatsApp subscription.

await segmentify.Events.UnsubscribeUser({
channel: 'whatsapp',
phone: '905551234567'
})
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"
}

UnsubscribeUser → USER_UNSUBSCRIBE (channel: sms)

Section titled “UnsubscribeUser → USER_UNSUBSCRIBE (channel: sms)”

Sent when a user cancels the SMS subscription.

await segmentify.Events.UnsubscribeUser({
channel: 'sms',
phone: '905551234567'
})
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"
}

UnsubscribeUser → USER_UNSUBSCRIBE (channel: call)

Section titled “UnsubscribeUser → USER_UNSUBSCRIBE (channel: call)”

Sent when a user cancels the call subscription.

await segmentify.Events.UnsubscribeUser({
channel: 'call',
phone: '905551234567'
})
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"
}