identify
await cow.identify({ identifiers: { userId: "user_1" },});| Field | Required | Notes |
|---|---|---|
identifiers |
yes | Who the write is about. At least one; two in one call link them, within the app you sent through. |
traits |
no | Any JSON object. Merged, not replaced. |
consent |
no | Consent per purpose, for the purposes your repo declares. |
timestamp |
no | ISO 8601 UTC, for a historical write. Never in the future. |
sourceId |
on the wire | The client’s, unless the call names one. |
Identifiers
Section titled “Identifiers”identifiers is a map from kind to value: userId, anonymousId, email, clerkId. Cowliss owns the profile id (usr_…) and resolves your map to it, so you never invent one and never send one back.
// An anonymous visitor.await cow.identify({ identifiers: { anonymousId: "anon_9f3" } });
// They sign up: naming both links them, history included. No alias call.await cow.identify({ identifiers: { anonymousId: "anon_9f3", userId: "user_1" },});Linking stops at the app. The sourceId on the call says which app the write belongs to, and a profile belongs to one app, so an identifier only ever joins identifiers under that app. Send the same userId to two of your products and you have two profiles, one per product, each with its own traits, consent and history.
Traits merge: keys you send are written, keys you leave out are untouched, and a null deletes the key. Writes are synchronous, so once the call has answered, segment membership is current and any journey it triggered has started. The full resolution rules, including what happens when two known people collide, are in Identity.
Reserved traits
Section titled “Reserved traits”emailVerifiedAt and emailVerifiedAddress are Cowliss’s to write: sending them is a 422. See Email templates.