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

# Get Retention Analysis

> **Description:** Retrieves retention analysis based on the specified start and end dates.

**Parameters:**
- `period`: The start and end dates

**Header**
- `x-api-key`: Your API Key (Dashboard->Settings)

**Returns:**
- `RetentionAnalysisResponse`: The transformed retention analysis data.

**Raises:**
- `HTTPException`: If an error occurs during the retrieval process.



## OpenAPI

````yaml https://ebn.telemetree.io/public-api/openapi.json get /retention
openapi: 3.1.0
info:
  title: Telemetree API
  description: Telemetree Public API endpoints.
  termsOfService: https://docs.telemetree.io/essentials/terms-of-service
  contact:
    name: Chris
    url: https://t.me/telemetree_referral
    email: chris@telemetree.io
  version: 1.0.0
servers:
  - url: https://ebn.telemetree.io/public-api
security: []
paths:
  /retention:
    get:
      tags:
        - Retention API
      summary: Get Retention Analysis
      description: >-
        **Description:** Retrieves retention analysis based on the specified
        start and end dates.


        **Parameters:**

        - `period`: The start and end dates


        **Header**

        - `x-api-key`: Your API Key (Dashboard->Settings)


        **Returns:**

        - `RetentionAnalysisResponse`: The transformed retention analysis data.


        **Raises:**

        - `HTTPException`: If an error occurs during the retrieval process.
      operationId: Get_retention_analysis_retention_get
      parameters:
        - name: group_by
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Group By
          example: country
        - name: start
          in: query
          required: true
          schema:
            type: string
            description: Start date in YYYYMMDD format
            title: Start
          description: Start date in YYYYMMDD format
          example: '20240801'
        - name: end
          in: query
          required: true
          schema:
            type: string
            description: End date in YYYYMMDD format
            title: End
          description: End date in YYYYMMDD format
          example: '20240830'
        - name: filters
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Filters
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RetentionDataResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - api_key: []
components:
  schemas:
    RetentionDataResponse:
      properties:
        data:
          items:
            $ref: '#/components/schemas/RetentionDataMain'
          type: array
          title: Data
          description: The retention data
      type: object
      required:
        - data
      title: RetentionDataResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    RetentionDataMain:
      properties:
        cohorts:
          additionalProperties:
            additionalProperties:
              $ref: '#/components/schemas/CohortsRetentionEntry'
            type: object
          type: object
          title: Cohorts
          description: The cohorts
        retentionMatrix:
          items:
            items:
              anyOf:
                - type: string
                - type: number
            type: array
          type: array
          title: Retentionmatrix
          description: The retention matrix
        combinedRetention:
          items:
            type: number
          type: array
          title: Combinedretention
          description: The combined retention
        totalUsers:
          type: integer
          title: Totalusers
          description: The total number of users
        groupBy:
          anyOf:
            - type: string
            - type: 'null'
          title: Groupby
          description: The group by
        groups:
          anyOf:
            - items:
                additionalProperties:
                  $ref: '#/components/schemas/RetentionDataGroup'
                type: object
              type: array
            - type: 'null'
          title: Groups
          description: The groups
      type: object
      required:
        - cohorts
        - retentionMatrix
        - combinedRetention
        - totalUsers
        - groupBy
        - groups
      title: RetentionDataMain
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    CohortsRetentionEntry:
      properties:
        totalUsers:
          type: integer
          title: Totalusers
          description: The total number of users
        retention:
          additionalProperties:
            type: number
          type: object
          title: Retention
          description: The retention
      type: object
      required:
        - totalUsers
        - retention
      title: CohortsRetentionEntry
    RetentionDataGroup:
      properties:
        cohorts:
          additionalProperties:
            additionalProperties:
              $ref: '#/components/schemas/CohortsRetentionEntry'
            type: object
          type: object
          title: Cohorts
          description: The cohorts
        retentionMatrix:
          items:
            items:
              anyOf:
                - type: string
                - type: number
            type: array
          type: array
          title: Retentionmatrix
          description: The retention matrix
        combinedRetention:
          items:
            type: number
          type: array
          title: Combinedretention
          description: The combined retention
        totalUsers:
          type: integer
          title: Totalusers
          description: The total number of users
      type: object
      required:
        - cohorts
        - retentionMatrix
        - combinedRetention
        - totalUsers
      title: RetentionDataGroup
  securitySchemes:
    api_key:
      type: apiKey
      description: Your API Key (Dashboard->Settings)
      in: header
      name: x-api-key

````