DocumentationLink User API

Link User API

Attaches a device to one of your users. Every event that device sent before the call — including in previous sessions — is retroactively attributed to that user, so nothing is lost.

POST /api/tracker/link-user/

bash
curl -X POST https://www.nohmo.in/api/tracker/link-user/ \
-H "Content-Type: application/json" \
-H "X-API-Key: pk_xxxx" \
-d '{
"deviceId": "a1b2c3d4...",
"userId": "user_42",
"email": "ada@example.com",
"meta": { "plan": "pro" }
}'
FieldRequiredDescription
deviceIdThe device to link. Must already exist — send an event or call /identify/ first
userIdYour stable identifier for the user
emailStored on the profile; used to merge the same user across devices
metaAny JSON object of user properties (plan, role, signup date)

Response

json
{ "success": true, "data": { "ok": true } }

Note: Calling this again with the same userId from another device merges the two profiles, which is how one person using a phone and a laptop stays one user.

StatusMeaning
400Invalid JSON, or deviceId / userId missing
401API key missing or invalid
404No device with that deviceId in this project