PUT
/
users
/
{id}
JavaScript
import { TrophyApiClient } from '@trophyso/node';

const trophy = new TrophyApiClient({
  apiKey: 'YOUR_API_KEY'
});

const response = await trophy.users.identify("user-id", {
  email: 'user@example.com',
  tz: 'Europe/London',
  attributes: {
    department: 'engineering',
    role: 'developer'
  }
});
{
  "email": "user@example.com",
  "name": "User",
  "tz": "Europe/London",
  "deviceTokens": [
    "token1",
    "token2"
  ],
  "subscribeToEmails": true,
  "attributes": {
    "department": "engineering",
    "role": "developer"
  },
  "id": "user-id",
  "control": false,
  "created": "2021-01-01T00:00:00Z",
  "updated": "2021-01-01T00:00:00Z"
}

Authorizations

X-API-KEY
string
header
required

Path Parameters

id
string
required

ID of the user to identify.

Body

application/json

The user object.

Response

200
application/json

Upserted user

A user of your application. An object with editable user fields.