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

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

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

Authorizations

X-API-KEY
string
header
required

Path Parameters

id
string
required

The user's ID in your database.

Body

application/json

Request body for updating user preferences.

notifications
NotificationPreferences · object

Notification preferences for each notification type.

Response

Successful operation

A user's preferences.

notifications
NotificationPreferences · object
required

Notification preferences for each notification type.