> ## 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 summary of points events over time

> Get a summary of points awards over time for a user for a specific points system.



## OpenAPI

````yaml https://api.trophy.so/v1/openapi get /users/{id}/points/{key}/event-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:
  /users/{id}/points/{key}/event-summary:
    servers:
      - url: https://api.trophy.so/v1
        description: Application API
    parameters:
      - $ref: '#/components/parameters/TenantId'
    get:
      tags:
        - Users
      summary: Get a summary of points events over time
      description: >-
        Get a summary of points awards over time for a user for a specific
        points system.
      operationId: users_points_event_summary
      parameters:
        - name: id
          in: path
          description: ID of the user.
          required: true
          schema:
            type: string
          example: userId
        - name: key
          in: path
          description: Key of the points system.
          required: true
          schema:
            type: string
          example: points-system-key
        - name: aggregation
          in: query
          description: The time period over which to aggregate the event data.
          required: true
          schema:
            type: string
            enum:
              - daily
              - weekly
              - monthly
          example: daily
        - name: startDate
          in: query
          description: >-
            The start date for the data range in YYYY-MM-DD format. The
            startDate must be before the endDate, and the date range must not
            exceed 400 days.
          required: true
          schema:
            type: string
            format: date
          example: '2024-01-01'
        - name: endDate
          in: query
          description: >-
            The end date for the data range in YYYY-MM-DD format. The endDate
            must be after the startDate, and the date range must not exceed 400
            days.
          required: true
          schema:
            type: string
            format: date
          example: '2024-01-31'
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    date:
                      type: string
                      format: date
                      description: >-
                        The date of the data point. For weekly or monthly
                        aggregations, this is the first date of the period.
                      example: '2024-01-01'
                    total:
                      type: number
                      format: double
                      description: The user's total points at the end of this date.
                      example: 100
                    change:
                      type: number
                      format: double
                      description: >-
                        The change in the user's total points during this
                        period.
                      example: 50
                  required:
                    - date
                    - total
                    - change
              examples:
                Successful operation:
                  value:
                    - date: '2024-01-01'
                      total: 100
                      change: 100
                    - date: '2024-01-02'
                      total: 300
                      change: 200
                    - date: '2024-01-03'
                      total: 600
                      change: 300
        '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.users.pointsEventSummary("user-id",
            "points-system-key", {
              aggregation: "daily",
              startDate: "2024-01-01",
              endDate: "2024-01-31"
            });
        - lang: python
          source: |
            from trophy import TrophyApi

            client = TrophyApi(api_key='YOUR_API_KEY')

            response = client.users.points_event_summary(
              id="user-id",
              key="points-system-key",
              aggregation="daily",
              start_date="2024-01-01",
              end_date="2024-01-31"
            )
        - 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.Users.PointsEventSummary(
              context.TODO(),
              "user-id",
              "points-system-key",
              &api.UsersPointsEventSummaryRequest{
                Aggregation: api.UsersPointsEventSummaryRequestAggregationDaily,
                StartDate: "2024-01-01",
                EndDate: "2024-01-31",
              },
            )
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:
    ErrorBody:
      title: ErrorBody
      type: object
      properties:
        error:
          type: string
      required:
        - error
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY

````