Skip to main content
GET
/
users
/
{id}
/
preferences
JavaScript
import { TrophyApiClient } from '@trophyso/node';

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

const response = await trophy.users.getPreferences("user-123");
{
  "notifications": {
    "achievement_completed": [
      "email",
      "push"
    ],
    "recap": [
      "email"
    ],
    "reactivation": [
      "push"
    ],
    "streak_reminder": [
      "email",
      "push"
    ]
  }
}

Authorizations

X-API-KEY
string
header
required

Path Parameters

id
string
required

The user's ID in your database.

Response

Successful operation

A user's preferences.

notifications
NotificationPreferences · object
required

Notification preferences for each notification type.