A User represents a person who may need to be notified of some action occurring in your product.
If you've used a Customer Data Platform (CDP) like Segment before, sending data to Knock will be familiar to you.
The identifier for a user is important as it's the unique key that we will use to merge users and
determine recipients for a notification. Generally, the best practice here is to use your internal
identifier for your users as the
The following attributes are required for each user you identify with Knock.
|id||An identifier for this user from your system, should be unique|
|The primary email address for this user|
|name||The full name of this user|
The following attributes are optional, depending on the channel types you decide to use with Knock.
|avatar||A URL for the avatar of the user|
|phone_number||The E.164 phone number of the user. Knock needs this to send recipients SMS notifications|
In addition to the system attributes defined on the user schema above, Knock will keep track of any
properties (key/value pairs) that you send to us. These traits are always merged onto a user and returned to you.
Traits are useful for when you need to perform additional personalization on a user, like de-normalizing the current plan they're on so you can use this to determine the portion of a notification they should receive.
You can nest the properties you send as deeply as you like, but please remember that we will not deep merge these keys.
Once sent to Knock, the user object returned to you in the Knock payload looks like this:
|id||The unique user identifier|
|properties||A map containing the traits sent for this user|
|preferences||The preference object associated with this user|
|updated_at||The last time in which we updated the user|