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

# Get Statistic Definition

> Get current statistic definition information

Allowed entity token types: title, game_server

## Error codes

This operation may return the following PlayFab errors:

| Error | Code |
| --- | --- |
| StatisticNotFound | 1195 |




## OpenAPI

````yaml post /Statistic/GetStatisticDefinition
openapi: 3.0.0
info:
  version: '260922'
  title: PlayFab Progression API
  description: Manage entity statistics Manage entity leaderboards
  termsOfService: https://playfab.com/terms/
  contact:
    url: https://community.playfab.com/index.html
  license:
    name: Apache 2.0
    url: https://github.com/PlayFab/API_Specs/blob/master/LICENSE
servers:
  - url: https://{titleId}.playfabapi.com
    description: PlayFab title endpoint
    variables:
      titleId:
        default: your_title_id
        description: Your PlayFab title ID (hex).
security: []
tags:
  - name: Leaderboards
    description: Leaderboards APIs
  - name: Statistics
    description: Statistics APIs
paths:
  /Statistic/GetStatisticDefinition:
    post:
      tags:
        - Statistics
      summary: Get Statistic Definition
      description: |
        Get current statistic definition information

        Allowed entity token types: title, game_server

        ## Error codes

        This operation may return the following PlayFab errors:

        | Error | Code |
        | --- | --- |
        | StatisticNotFound | 1195 |
      operationId: GetStatisticDefinition
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GetStatisticDefinitionRequest'
      responses:
        '200':
          $ref: '#/components/responses/GetStatisticDefinitionResponse'
        '400':
          $ref: '#/components/responses/ApiErrorWrapper'
      security:
        - EntityToken: []
components:
  schemas:
    GetStatisticDefinitionRequest:
      type: object
      properties:
        CustomTags:
          description: >-
            The optional custom tags associated with the request (e.g. build
            number, external trace identifiers, etc.).
          type: object
        Name:
          description: Name of the statistic. Must be less than 150 characters.
          type: string
      required:
        - Name
      example:
        Name: Points
    GetStatisticDefinitionResponse:
      type: object
      properties:
        AggregationDestinations:
          description: >-
            The list of statistic definitions names this definition aggregates
            to. 
          type: array
          items:
            type: string
        AggregationSources:
          description: >-
            The list of statistic definitions names whose values must be
            aggregated towards this stat. If AggregationSource is specified, the
            entityType of this definition MUST be Title (making it a
            CommunityStat). Currently, only one aggregation source can be
            specified.
          type: array
          items:
            type: string
        Columns:
          description: >-
            The columns for the statistic defining the aggregation method for
            each column.
          type: array
          items:
            $ref: '#/components/schemas/StatisticColumn'
          x-isclass: true
        Created:
          description: Created time, in UTC
          type: string
        EntityType:
          description: The entity type that can have this statistic.
          type: string
        EventEmissionConfig:
          allOf:
            - $ref: '#/components/schemas/StatisticsEventEmissionConfig'
          description: >-
            [In Preview]: Configurations for different Statistics events that
            can be emitted by the service.
        LastResetTime:
          description: Last time, in UTC, statistic version was incremented.
          type: string
        LinkedLeaderboardNames:
          description: >-
            The list of leaderboards that are linked to this statistic
            definition.
          type: array
          items:
            type: string
        Name:
          description: Name of the statistic.
          type: string
        Version:
          description: Statistic version.
          type: number
          x-actualtype: uint32
        VersionConfiguration:
          allOf:
            - $ref: '#/components/schemas/VersionConfiguration'
          description: The version reset configuration for the leaderboard definition.
      required:
        - Version
        - Created
      example:
        Name: Points
        Columns:
          - AggregationMethod: Min
        EntityType: title_player_account
        Version: 89
        EventEmissionConfig:
          UpdateEventConfig: {}
    ApiErrorWrapper:
      description: The basic wrapper around every failed API response
      type: object
      properties:
        code:
          description: Numerical HTTP code
          type: integer
        status:
          description: String HTTP code
          type: string
        error:
          description: Playfab error code
          type: string
        errorCode:
          description: Numerical PlayFab error code
          type: integer
        errorMessage:
          description: Description for the PlayFab errorCode
          type: string
        errorDetails:
          description: Detailed description of individual issues with the request object
          type: object
      required:
        - code
        - errorCode
    StatisticColumn:
      type: object
      properties:
        AggregationMethod:
          allOf:
            - $ref: '#/components/schemas/StatisticAggregationMethod'
          description: Aggregation method for calculating new value of a statistic.
        Name:
          description: Name of the statistic column, as originally configured.
          type: string
      required:
        - Name
        - AggregationMethod
    StatisticsEventEmissionConfig:
      type: object
      properties:
        UpdateEventConfig:
          allOf:
            - $ref: '#/components/schemas/StatisticsUpdateEventConfig'
          description: Emitted when statistics are updated.
    VersionConfiguration:
      type: object
      properties:
        MaxQueryableVersions:
          description: >-
            The maximum number of versions of this leaderboard/statistic that
            can be queried. 
          type: number
          x-actualtype: int32
        ResetInterval:
          allOf:
            - $ref: '#/components/schemas/ResetInterval'
          description: >-
            Reset interval that statistics or leaderboards will reset on. When
            using Manual intervalthe reset can only be increased by calling the
            Increase version API. When using Hour interval the resetwill occur
            at the start of the next hour UTC time. When using Day interval the
            reset will occur at thestart of the next day in UTC time. When using
            the Week interval the reset will occur at the start ofthe next
            Monday in UTC time. When using Month interval the reset will occur
            at the start of the nextmonth in UTC time.
      required:
        - ResetInterval
        - MaxQueryableVersions
    StatisticAggregationMethod:
      type: string
      enum:
        - Last
        - Min
        - Max
        - Sum
    StatisticsUpdateEventConfig:
      type: object
      properties:
        EventType:
          allOf:
            - $ref: '#/components/schemas/EventType'
          description: The event type to emit when statistics are updated.
      required:
        - EventType
    ResetInterval:
      type: string
      enum:
        - Manual
        - Hour
        - Day
        - Week
        - Month
    EventType:
      type: string
      enum:
        - None
        - Telemetry
        - PlayStream
  responses:
    GetStatisticDefinitionResponse:
      description: ''
      content:
        application/json:
          schema:
            type: object
            properties:
              code:
                type: integer
                description: >-
                  The Http status code. If X-ReportErrorAsSuccess header is set
                  to true, this will report the actual http error code.
              status:
                type: string
                description: The Http status code as a string.
              data:
                $ref: '#/components/schemas/GetStatisticDefinitionResponse'
            example:
              code: 200
              status: OK
              data:
                Name: Points
                Columns:
                  - AggregationMethod: Min
                EntityType: title_player_account
                Version: 89
                EventEmissionConfig:
                  UpdateEventConfig: {}
    ApiErrorWrapper:
      description: This is the outer wrapper for all responses with errors
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiErrorWrapper'
  securitySchemes:
    EntityToken:
      type: apiKey
      in: header
      name: X-EntityToken
      description: >-
        This API requires an Entity Session Token, available from the Entity
        GetEntityToken method.

````

## Related topics

- [Get Statistic Definition](/api-reference/statistics/get-statistic-definition.md)
- [PFStatisticsGetStatisticDefinitionAsync](/services/playfab/api-references/c/pfstatistics/functions/pfstatisticsgetstatisticdefinitionasync.md)
- [PFStatisticsGetStatisticDefinitionRequest](/services/playfab/api-references/c/pfstatisticstypes/structs/pfstatisticsgetstatisticdefinitionrequest.md)
- [PFStatisticsGetStatisticDefinitionGetResult](/services/playfab/api-references/c/pfstatistics/functions/pfstatisticsgetstatisticdefinitiongetresult.md)
- [PFStatisticsGetStatisticDefinitionResponse](/services/playfab/api-references/c/pfstatisticstypes/structs/pfstatisticsgetstatisticdefinitionresponse.md)
