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

# Get a session by user id

> Get a session by user id.



## OpenAPI

````yaml https://api.gleap.io/api-docs.json get /sessions/by-user-id/{userId}
openapi: 3.0.0
info:
  title: gleap-server
  version: 14.0.0
  contact: {}
servers:
  - url: https://api.gleap.io/v3
security: []
paths:
  /sessions/by-user-id/{userId}:
    get:
      tags:
        - Session
      summary: Get a session by user id
      description: Get a session by user id.
      operationId: FindSessionByUserId
      parameters:
        - in: header
          name: project
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Ok
          content:
            application/json:
              schema:
                allOf:
                  - properties:
                      eventData: {}
                      checklistTasks: {}
                      outboundHistory: {}
                      plan:
                        type: string
                      telegramUsername:
                        type: string
                      telegramChatId:
                        type: string
                      instagramUsername:
                        type: string
                      instagramId:
                        type: string
                      facebookId:
                        type: string
                      phone:
                        type: string
                      sla:
                        type: number
                        format: double
                      companyName:
                        type: string
                      platform:
                        type: string
                      deviceType:
                        type: string
                      companyId:
                        type: string
                      avatar:
                        type: string
                      location: {}
                      lastPageView: {}
                      unsubscribedAt:
                        type: string
                        format: date-time
                      unsubscribeReason:
                        type: string
                      lastFeedbackReport:
                        type: string
                        format: date-time
                      lastActivity:
                        type: string
                        format: date-time
                      lastHeardFrom:
                        type: string
                        format: date-time
                      gleapHash:
                        type: string
                      gleapId:
                        type: string
                      customData: {}
                      project:
                        properties:
                          isValid:
                            properties: {}
                            type: object
                          createFromHexString:
                            properties: {}
                            type: object
                          createFromTime:
                            properties: {}
                            type: object
                          generate:
                            properties: {}
                            type: object
                          cacheHexString: {}
                        type: object
                      email:
                        type: string
                      userId:
                        type: string
                      organisation:
                        properties:
                          isValid:
                            properties: {}
                            type: object
                          createFromHexString:
                            properties: {}
                            type: object
                          createFromTime:
                            properties: {}
                            type: object
                          generate:
                            properties: {}
                            type: object
                          cacheHexString: {}
                        type: object
                      name:
                        type: string
                      countFeedbackComments:
                        type: number
                        format: double
                      countFeedbackReports:
                        type: number
                        format: double
                      memory:
                        items:
                          properties:
                            actorUserId:
                              properties:
                                isValid:
                                  properties: {}
                                  type: object
                                createFromHexString:
                                  properties: {}
                                  type: object
                                createFromTime:
                                  properties: {}
                                  type: object
                                generate:
                                  properties: {}
                                  type: object
                                cacheHexString: {}
                              type: object
                            actor:
                              type: string
                            updatedAt:
                              type: string
                              format: date-time
                            createdAt:
                              type: string
                              format: date-time
                            content:
                              type: string
                            description:
                              type: string
                            name:
                              type: string
                          required:
                            - actor
                            - updatedAt
                            - createdAt
                            - content
                            - description
                            - name
                          type: object
                        type: array
                      tags:
                        items:
                          type: string
                        type: array
                      sessions:
                        type: number
                        format: double
                      emailOnly:
                        type: boolean
                      blocked:
                        type: boolean
                      unsubscribed:
                        type: boolean
                      firstActivity:
                        type: string
                        format: date-time
                      lang:
                        type: string
                      updatedAt:
                        type: string
                        format: date-time
                      value:
                        type: number
                        format: double
                      createdAt:
                        type: string
                        format: date-time
                      _id:
                        properties:
                          isValid:
                            properties: {}
                            type: object
                          createFromHexString:
                            properties: {}
                            type: object
                          createFromTime:
                            properties: {}
                            type: object
                          generate:
                            properties: {}
                            type: object
                          cacheHexString: {}
                        type: object
                    required:
                      - countFeedbackComments
                      - countFeedbackReports
                      - memory
                      - tags
                      - sessions
                      - emailOnly
                      - blocked
                      - unsubscribed
                      - firstActivity
                      - lang
                      - updatedAt
                      - value
                      - createdAt
                      - _id
                    type: object
                  - $ref: '#/components/schemas/Document_any.any.any_'
                  - properties:
                      _id:
                        $ref: '#/components/schemas/ObjectId'
                    required:
                      - _id
                    type: object
      security:
        - jwt: []
components:
  schemas:
    Document_any.any.any_:
      $ref: '#/components/schemas/FlattenMaps_T_'
      description: >-
        Generic types for Document:

        *  T - the type of _id

        *  TQueryHelpers - Object with any helpers that should be mixed into the
        Query type

        *  DocType - the type of the actual Document created
    ObjectId:
      type: string
    FlattenMaps_T_:
      properties: {}
      type: object
  securitySchemes:
    jwt:
      type: http
      scheme: bearer
      bearerFormat: JWT

````