> ## 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 Average Session Length

> **Description:** Retrieves average session length 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:**
- `AverageSessionLengthResponse`: The transformed average session length data.

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



## OpenAPI

````yaml https://ebn.telemetree.io/public-api/openapi.json get /sessions/average
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:
  /sessions/average:
    get:
      tags:
        - Events API
      summary: Get Average Session Length
      description: >-
        **Description:** Retrieves average session length 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:**

        - `AverageSessionLengthResponse`: The transformed average session length
        data.


        **Raises:**

        - `HTTPException`: If an error occurs during the retrieval process.
      operationId: Get_average_session_length_sessions_average_get
      parameters:
        - 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'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BaseGraphDataModel'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - api_key: []
components:
  schemas:
    BaseGraphDataModel:
      properties:
        xValues:
          $ref: '#/components/schemas/XAxis'
        yValues:
          items:
            $ref: '#/components/schemas/YAxis'
          type: array
          title: Yvalues
      type: object
      required:
        - xValues
        - yValues
      title: BaseGraphDataModel
      description: Base class for the analytical dashboard information request
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    XAxis:
      properties:
        name:
          type: string
          title: Name
        data_type:
          anyOf:
            - $ref: '#/components/schemas/DataEnum'
            - type: string
          title: Data Type
        length:
          anyOf:
            - type: integer
            - type: 'null'
          title: Length
        key_value:
          anyOf:
            - type: integer
            - type: number
            - type: string
            - type: 'null'
          title: Key Value
        empty:
          type: boolean
          title: Empty
          default: false
        data:
          items:
            type: string
          type: array
          title: Data
      type: object
      required:
        - name
        - data_type
        - data
      title: XAxis
      description: X-axis information
    YAxis:
      properties:
        name:
          type: string
          title: Name
        data_type:
          anyOf:
            - $ref: '#/components/schemas/DataEnum'
            - type: string
          title: Data Type
        length:
          anyOf:
            - type: integer
            - type: 'null'
          title: Length
        key_value:
          anyOf:
            - type: integer
            - type: number
            - type: string
            - type: 'null'
          title: Key Value
        empty:
          type: boolean
          title: Empty
          default: false
        data:
          items:
            anyOf:
              - type: integer
              - type: number
              - items: {}
                type: array
          type: array
          title: Data
        change:
          anyOf:
            - type: integer
            - type: number
            - type: string
            - type: 'null'
          title: Change
      type: object
      required:
        - name
        - data_type
        - data
      title: YAxis
      description: Y-axis information
    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
    DataEnum:
      type: string
      enum:
        - time_series
        - categorical
        - numerical
      title: DataEnum
      description: Enum for the data type
  securitySchemes:
    api_key:
      type: apiKey
      description: Your API Key (Dashboard->Settings)
      in: header
      name: x-api-key

````