Saltar al contenido principal
POST
/
points
/
boosts
JavaScript
import { TrophyApiClient } from '@trophyso/node';

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

const response = await trophy.admin.points.boosts.create({
  systemKey: 'xp',
  boosts: [
    {
      userId: 'user-123',
      name: 'Double XP Weekend',
      start: '2024-01-01',
      end: '2024-01-03',
      multiplier: 2
    },
    {
      userId: 'user-456',
      name: 'Holiday Bonus',
      start: '2024-12-25',
      multiplier: 1.5,
      rounding: 'up'
    }
  ]
});
{
  "created": [],
  "issues": [
    {
      "userId": "non-existent-user",
      "level": "error",
      "reason": "User does not exist"
    }
  ]
}
Límites de tasa

Autorizaciones

X-API-KEY
string
header
requerido

Cuerpo

application/json

The points system key and array of boosts to create

Request body for creating points boosts.

systemKey
string
requerido

The key of the points system to create boosts for.

Ejemplo:

"xp"

boosts
object[]
requerido

Array of boosts to create. Maximum 1,000 boosts per request.

Required array length: 1 - 1000 elements

Respuesta

Successful operation (no boosts created)

Response containing created boosts and any issues encountered while creating points boosts.

created
CreatedPointsBoost · object[]
requerido

Array of successfully created boosts.

issues
BulkInsertIssue · object[]
requerido

Array of issues encountered during boost creation.