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

# List sessions

> Returns all sessions for a given account ID. The account ID is obtained from an authorization grant.

**Required scopes:** `sessions--my:ro`


## OpenAPI

````yaml /api/global-accounts/openapi.json get /sessions
openapi: 3.0.0
info:
  title: Global Accounts API
  description: >-
    API used to manage Organizations and Accounts for multiple products. Also
    responsible for authorization and authentication processes.
  version: 2.0.0
servers:
  - url: https://accounts.livechat.com/v2
    description: Main production server URL
security: []
paths:
  /sessions:
    get:
      tags:
        - Sessions
      summary: List sessions
      description: >-
        Returns all sessions for a given account ID. The account ID is obtained
        from an authorization grant.
      responses:
        '200':
          description: 'OK: Returns the list of sessions.'
          content:
            application/json:
              schema:
                type: array
                items:
                  description: A scope describing a single user permission.
                  type: object
                  properties:
                    account_id:
                      type: string
                      format: uuid
                      readOnly: true
                      description: Unique account identifier.
                    session_id:
                      type: string
                      format: uuid
                      description: Unique session identifier.
                      readOnly: true
                    current:
                      type: boolean
                      description: >-
                        If `true`: the access token used to request the data
                        belongs to the current session.
                      readOnly: true
                    user_agent:
                      type: string
                      description: >-
                        Name of the user agent (device) on which the session was
                        established.
                      readOnly: true
                    identity_source:
                      type: string
                      description: The type of identity source.
                      enum:
                        - credentials
                        - explicit
                        - google
                        - token
                        - microsoft
                        - apple
                      readOnly: true
                    ip:
                      type: string
                      description: >-
                        IP address of the computer on which the session was
                        established.
                      readOnly: true
                    applications:
                      type: array
                      items:
                        description: Basic information about the application.
                        properties:
                          name:
                            type: string
                            readOnly: true
                          client_id:
                            type: string
                            readOnly: true
                          session_id:
                            type: string
                            format: uuid
                            description: Unique session identifier.
                            readOnly: true
              example:
                - account_id: 496a94f2-cbbf-444e-a3cb-305b9f5f8cbb
                  session_id: bfeeb033-bc8e-467f-982d-22dcef274fa1
                  current: true
                  user_agent: >-
                    Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML,
                    like Gecko) Chrome/92.0.4515.107 Safari/537.36
                  identity_source: credentials
                  ip: 198.51.100.14
                  applications:
                    - name: LiveChat
                      client_id: 0805e283233042b37f460ed8fbf22160
                      session_id: 4cf5be18-8053-4ef4-9891-4a2a71b2b1c3
        '401':
          description: Unauthorized, missing, or invalid authorization.
          content:
            application/json:
              schema:
                allOf:
                  - description: The default error object.
                    type: object
                    properties:
                      error:
                        description: The error code.
                        type: string
                        enum:
                          - bad_request
                          - invalid_request
                          - unauthorized_client
                          - unauthorized
                          - access_denied
                          - unsupported_response_type
                          - invalid_scope
                          - server_error
                          - temporarily_unavailable
                          - unsupported_grant_type
                          - invalid_grant
                          - invalid_client
                          - conflict
                          - resource_not_found
                          - join_link_expired
                          - traffic_blocked
                          - not_implemented
                      error_description:
                        type: string
                      sub_error:
                        description: The error subcode.
                        type: string
                        nullable: true
                      request_id:
                        description: Unique request identifier.
                        type: string
                        format: uuid
                  - type: object
                    properties:
                      error:
                        type: string
                      error_description:
                        type: string
              example:
                error: unauthorized
                error_description: The account is not authorized.
                request_id: 5903c51b-89f0-41a9-a25d-4f39af100353
        '403':
          description: 'Forbidden: Insufficient scope.'
          content:
            application/json:
              schema:
                allOf:
                  - description: The default error object.
                    type: object
                    properties:
                      error:
                        description: The error code.
                        type: string
                        enum:
                          - bad_request
                          - invalid_request
                          - unauthorized_client
                          - unauthorized
                          - access_denied
                          - unsupported_response_type
                          - invalid_scope
                          - server_error
                          - temporarily_unavailable
                          - unsupported_grant_type
                          - invalid_grant
                          - invalid_client
                          - conflict
                          - resource_not_found
                          - join_link_expired
                          - traffic_blocked
                          - not_implemented
                      error_description:
                        type: string
                      sub_error:
                        description: The error subcode.
                        type: string
                        nullable: true
                      request_id:
                        description: Unique request identifier.
                        type: string
                        format: uuid
                  - type: object
                    properties:
                      error:
                        type: string
                      sub_error:
                        type: string
                      error_description:
                        type: string
              example:
                error: access_denied
                sub_error: insufficient_scope
                error_description: The resource owner or authorization server denied the request.
                request_id: 5903c51b-89f0-41a9-a25d-4f39af100353
        '500':
          description: Server Error.
          content:
            application/json:
              schema:
                allOf:
                  - description: The default error object.
                    type: object
                    properties:
                      error:
                        description: The error code.
                        type: string
                        enum:
                          - bad_request
                          - invalid_request
                          - unauthorized_client
                          - unauthorized
                          - access_denied
                          - unsupported_response_type
                          - invalid_scope
                          - server_error
                          - temporarily_unavailable
                          - unsupported_grant_type
                          - invalid_grant
                          - invalid_client
                          - conflict
                          - resource_not_found
                          - join_link_expired
                          - traffic_blocked
                          - not_implemented
                      error_description:
                        type: string
                      sub_error:
                        description: The error subcode.
                        type: string
                        nullable: true
                      request_id:
                        description: Unique request identifier.
                        type: string
                        format: uuid
                  - type: object
                    properties:
                      error:
                        type: string
                      error_description:
                        type: string
              example:
                error: server_error
                error_description: >-
                  The server encountered an unexpected condition that prevented
                  it from fulfilling the request.
                request_id: 5903c51b-89f0-41a9-a25d-4f39af100353
      security:
        - OAuth2BearerToken:
            - sessions--my:ro
components:
  securitySchemes:
    OAuth2BearerToken:
      description: >-
        This API uses OAuth2 with the implicit grant flow. <a
        href="/authentication/oauth-authorization#implicit-grant">Learn about
        the implicit grant flow.</a>
      type: oauth2
      flows:
        implicit:
          authorizationUrl: https://accounts.livechat.com
          scopes: {}
        authorizationCode:
          authorizationUrl: https://accounts.livechat.com
          tokenUrl: https://accounts.livechat.com/token
          scopes: {}

````