> ## Documentation Index
> Fetch the complete documentation index at: https://docs.trophy.so/llms.txt
> Use this file to discover all available pages before exploring further.

# Get a points system with its triggers

> Get a points system with its triggers.



## OpenAPI

````yaml https://api.trophy.so/v1/openapi get /points/{key}
openapi: 3.1.0
info:
  title: Trophy
  version: 1.19.0
servers:
  - x-fern-server-name: Application API
    url: https://api.trophy.so/v1
    description: Application API
security: []
paths:
  /points/{key}:
    servers:
      - url: https://api.trophy.so/v1
        description: Application API
    parameters:
      - $ref: '#/components/parameters/TenantId'
    get:
      tags:
        - Points
      summary: Get a points system with its triggers
      description: Get a points system with its triggers.
      operationId: points_system
      parameters:
        - name: key
          in: path
          description: Key of the points system.
          required: true
          schema:
            type: string
          example: points-system-key
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PointsSystemResponse'
              examples:
                Successful operation:
                  value:
                    id: 0040fe51-6bce-4b44-b0ad-bddc4e123534
                    name: XP System
                    description: Experience points for user engagement
                    badgeUrl: https://example.com/badge.png
                    maxPoints: null
                    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
                        eventAttributes:
                          - key: source
                            value: mobile-app
                          - key: plan
                            value: premium
                        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'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '404':
          description: Points system not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
      security:
        - ApiKeyAuth: []
      x-codeSamples:
        - lang: javascript
          source: |
            import { TrophyApiClient } from '@trophyso/node';

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

            const response = await trophy.points.system("points-system-key");
        - lang: python
          source: |
            from trophy import TrophyApi

            client = TrophyApi(api_key='YOUR_API_KEY')

            response = client.points.system(key="points-system-key")
        - lang: go
          source: >
            import (
              "context"

              trophyclient "github.com/trophyso/trophy-go/client"
              "github.com/trophyso/trophy-go/option"
            )


            client := trophyclient.NewClient(
              option.WithApiKey("YOUR_API_KEY"),
            )


            response, err := client.Points.System(context.TODO(),
            "points-system-key")
components:
  parameters:
    TenantId:
      name: Tenant-ID
      in: header
      description: >-
        The tenant identifier for multi-tenant organisations. Required when the
        organisation has multi-tenancy enabled. The value should be your
        internal ID for the tenant. Ignored for single-tenant organisations.
      required: false
      schema:
        type: string
      example: customer_12345
  schemas:
    PointsSystemResponse:
      title: PointsSystemResponse
      type: object
      properties:
        id:
          type: string
          description: The unique ID of the points system.
        name:
          type: string
          description: The name of the points system.
        description:
          type:
            - string
            - 'null'
          description: The description of the points system.
        badgeUrl:
          type:
            - string
            - 'null'
          description: >-
            The URL of the badge image for the points system, if one has been
            uploaded.
        maxPoints:
          type:
            - number
            - 'null'
          description: >-
            The maximum number of points a user can be awarded in this points
            system
        triggers:
          type: array
          description: Array of active triggers for this points system.
          items:
            $ref: '#/components/schemas/PointsTrigger'
      required:
        - id
        - name
        - description
        - badgeUrl
        - maxPoints
        - triggers
    ErrorBody:
      title: ErrorBody
      type: object
      properties:
        error:
          type: string
      required:
        - error
    PointsTrigger:
      title: PointsTrigger
      type: object
      properties:
        id:
          type: string
          description: The ID of the trigger
        type:
          type: string
          description: The type of trigger
          enum:
            - metric
            - achievement
            - streak
            - time
            - user_creation
        points:
          type: integer
          description: The points awarded by this trigger.
        status:
          type: string
          enum:
            - active
            - inactive
            - archived
          description: The status of the trigger.
        achievementId:
          type: string
          description: >-
            The unique ID of the achievement associated with this trigger, if
            the trigger is an achievement.
        metricId:
          type: string
          description: >-
            The unique ID of the metric associated with this trigger, if the
            trigger is a metric.
        metricName:
          type: string
          description: If the trigger has type 'metric', the name of the metric
        metricThreshold:
          type: integer
          description: >-
            If the trigger has type 'metric', the threshold of the metric that
            triggers the points
        streakLengthThreshold:
          type: integer
          description: >-
            If the trigger has type 'streak', the threshold of the streak that
            triggers the points
        achievementName:
          type: string
          description: If the trigger has type 'achievement', the name of the achievement
        timeUnit:
          type: string
          enum:
            - hour
            - day
          description: >-
            If the trigger has type 'time', the unit of time after which to
            award points
        timeInterval:
          type: integer
          description: >-
            If the trigger has type 'time', the numer of units of timeUnit after
            which to award points
        userAttributes:
          type: array
          description: >-
            User attribute filters that must be met for this trigger to award
            points. Empty when the trigger has no user attribute filters
            configured.
          items:
            type: object
            properties:
              key:
                type: string
                description: The key of the user attribute.
                example: plan-type
              value:
                type: string
                description: The required value of the user attribute.
                example: premium
            required:
              - key
              - value
        eventAttribute:
          type: object
          description: >-
            Deprecated. Event attribute filter that must be met for this trigger
            to award points. Only present if the trigger has an event filter
            configured.
          deprecated: true
          properties:
            key:
              type: string
              description: The key of the event attribute.
              example: source
            value:
              type: string
              description: The required value of the event attribute.
              example: mobile-app
          required:
            - key
            - value
        eventAttributes:
          type: array
          description: >-
            If the trigger has type 'metric', the event attributes that must
            match for the trigger to award points. Empty when the trigger is
            metric-based and has no event attribute filters. Omitted for
            non-metric triggers.
          items:
            type: object
            properties:
              key:
                type: string
                description: The key of the event attribute.
                example: source
              value:
                type: string
                description: The required value of the event attribute.
                example: mobile-app
            required:
              - key
              - value
        created:
          type: string
          format: date-time
          description: The date and time the trigger was created, in ISO 8601 format.
        updated:
          type: string
          format: date-time
          description: The date and time the trigger was last updated, in ISO 8601 format.
      required:
        - id
        - type
        - points
        - status
        - userAttributes
        - created
        - updated
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY

````