Skip to main content
GET
/
points
/
{key}
JavaScript
import { TrophyApiClient } from '@trophyso/node';

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

const response = await trophy.points.system("points-system-key");
{
  "id": "0040fe51-6bce-4b44-b0ad-bddc4e123534",
  "name": "XP System",
  "description": "Experience points for user engagement",
  "badgeUrl": "https://example.com/badge.png",
  "triggers": [
    {
      "id": "0040fe51-6bce-4b44-b0ad-bddc4e123534",
      "type": "metric",
      "points": 10,
      "status": "active",
      "metricId": "0040fe51-6bce-4b44-b0ad-bddc4e123534",
      "metricName": "words written",
      "metricThreshold": 1000,
      "userAttributes": [
        {
          "key": "plan-type",
          "value": "premium"
        },
        {
          "key": "region",
          "value": "us-east"
        }
      ],
      "eventAttribute": {
        "key": "source",
        "value": "mobile-app"
      },
      "created": "2021-01-01T00:00:00Z",
      "updated": "2021-01-01T00:00:00Z"
    },
    {
      "id": "0040fe51-6bce-4b44-b0ad-bddc4e123536",
      "type": "streak",
      "points": 10,
      "status": "active",
      "streakLengthThreshold": 7,
      "created": "2021-01-01T00:00:00Z",
      "updated": "2021-01-01T00:00:00Z"
    },
    {
      "id": "0040fe51-6bce-4b44-b0ad-bddc4e123535",
      "type": "achievement",
      "points": 50,
      "status": "active",
      "achievementId": "0040fe51-6bce-4b44-b0ad-bddc4e123535",
      "achievementName": "finish onboarding",
      "userAttributes": [
        {
          "key": "plan-type",
          "value": "premium"
        }
      ],
      "created": "2021-01-01T00:00:00Z",
      "updated": "2021-01-01T00:00:00Z"
    }
  ]
}

Authorizations

X-API-KEY
string
header
required

Path Parameters

key
string
required

Key of the points system.

Response

Successful operation

id
string
required

The unique ID of the points system.

name
string
required

The name of the points system.

description
string | null
required

The description of the points system.

badgeUrl
string | null
required

The URL of the badge image for the points system, if one has been uploaded.

triggers
PointsTriggerResponse · object[]
required

Array of active triggers for this points system.

I