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" }}'
| Field | Required | Description |
|---|---|---|
| deviceId | ✓ | The device to link. Must already exist — send an event or call /identify/ first |
| userId | ✓ | Your stable identifier for the user |
| — | Stored on the profile; used to merge the same user across devices | |
| meta | — | Any 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.
| Status | Meaning |
|---|---|
| 400 | Invalid JSON, or deviceId / userId missing |
| 401 | API key missing or invalid |
| 404 | No device with that deviceId in this project |