> ## 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 breakdown of users by points

> Get a breakdown of the number of users with points in each range.



## OpenAPI

````yaml https://api.trophy.so/v1/openapi get /points/{key}/summary
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}/summary:
    servers:
      - url: https://api.trophy.so/v1
        description: Application API
    parameters:
      - $ref: '#/components/parameters/TenantId'
    get:
      tags:
        - Points
      summary: Get a breakdown of users by points
      description: Get a breakdown of the number of users with points in each range.
      operationId: points_summary
      parameters:
        - name: key
          in: path
          description: Key of the points system.
          required: true
          schema:
            type: string
          example: points-system-key
        - name: userAttributes
          in: query
          description: >-
            Optional colon-delimited user attribute filters in the format
            attribute:value,attribute:value. Only users matching ALL specified
            attributes will be included in the points breakdown.
          required: false
          schema:
            type: string
          example: plan-type:premium,region:us-east
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PointsSummaryResponse'
              examples:
                Successful operation:
                  value:
                    - from: 0
                      to: 0
                      users: 5012
                    - from: 1
                      to: 100
                      users: 1501
                    - from: 101
                      to: 200
                      users: 1007
                    - from: 201
                      to: 300
                      users: 584
                    - from: 301
                      to: 400
                      users: 201
                    - from: 401
                      to: 500
                      users: 102
                    - from: 501
                      to: 600
                      users: 25
                    - from: 601
                      to: 700
                      users: 0
                    - from: 701
                      to: 800
                      users: 0
                    - from: 801
                      to: 900
                      users: 0
                    - from: 901
                      to: 1000
                      users: 0
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '422':
          description: Unprocessible Entity
          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.summary("points-system-key", {
              userAttributes: "plan-type:premium,region:us-east"
            });
        - lang: python
          source: |
            from trophy import TrophyApi

            client = TrophyApi(api_key='YOUR_API_KEY')

            response = client.points.summary(
              key="points-system-key",
              user_attributes="plan-type:premium,region:us-east"
            )
        - lang: go
          source: |
            import (
              "context"

              api "github.com/trophyso/trophy-go"
              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.Summary(
              context.TODO(),
              "points-system-key",
              &api.PointsSummaryRequest{UserAttributes: api.String("plan-type:premium,region:us-east")},
            )
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:
    PointsSummaryResponse:
      title: PointsSummaryResponse
      type: array
      description: >-
        A list of eleven points ranges, with the first starting and ending at 0,
        and the remaining 10 being calculated as 10 equally sized ranges from 1
        to the greatest number of points a user has, rounded up to the nearest
        power of 10.
      items:
        $ref: '#/components/schemas/PointsRange'
    ErrorBody:
      title: ErrorBody
      type: object
      properties:
        error:
          type: string
      required:
        - error
    PointsRange:
      title: PointsRange
      type: object
      properties:
        from:
          type: integer
          description: The start of the points range. Inclusive.
        to:
          type: integer
          description: The end of the points range. Inclusive.
        users:
          type: integer
          description: The number of users in this points range.
      required:
        - from
        - to
        - users
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY

````