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

# List messages for a chat session

> Return the user's chat history for the given session. History remains readable after the session is no longer active.



## OpenAPI

````yaml /api-reference/mobilerun-va-chat.yaml get /assistant/chat/messages
openapi: 3.1.0
info:
  title: Mobilerun VA Chat
  version: v1
servers:
  - description: Droidrun Cloud API
    url: https://api.mobilerun.ai/v1
security:
  - bearerAuth: []
paths:
  /assistant/chat/messages:
    get:
      tags:
        - Chat
      summary: List messages for a chat session
      description: >-
        Return the user's chat history for the given session. History remains
        readable after the session is no longer active.
      operationId: chatMessages
      parameters:
        - in: query
          name: sessionId
          required: true
          schema:
            format: uuid
            type: string
        - in: query
          name: limit
          required: false
          schema:
            maximum: 500
            minimum: 1
            type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  messages:
                    items:
                      properties:
                        createdAt:
                          format: date-time
                          type: string
                        createdBy:
                          type:
                            - string
                            - 'null'
                        feedback:
                          type:
                            - boolean
                            - 'null'
                        id:
                          type: string
                        metadata:
                          properties:
                            agent:
                              type: string
                            agentMessageId:
                              type: string
                            agentSessionId:
                              type: string
                            turnAnchorMessageId:
                              type: string
                          type: object
                        parts:
                          items:
                            additionalProperties: {}
                            properties:
                              type:
                                type: string
                            required:
                              - type
                            type: object
                          type: array
                        role:
                          enum:
                            - user
                            - assistant
                            - system
                          type: string
                        source:
                          enum:
                            - cloud
                            - telegram
                            - api
                            - workflow
                            - notification
                          type: string
                        synthetic:
                          type: boolean
                        userId:
                          deprecated: true
                          description: 'Deprecated: use createdBy.'
                          type:
                            - string
                            - 'null'
                      required:
                        - id
                        - role
                        - parts
                      type: object
                    type: array
                  truncated:
                    type: boolean
                  turnActive:
                    type: boolean
                required:
                  - messages
                  - turnActive
                type: object
          description: User chat history
        '401':
          description: Unauthorized
        '404':
          content:
            application/json:
              schema:
                properties:
                  message:
                    type: string
                required:
                  - message
                type: object
          description: Unknown or archived sessionId
        '500':
          description: Internal Server Error
      x-codeSamples:
        - lang: JavaScript
          source: |-
            import Mobilerun from '@mobilerun/sdk';

            const client = new Mobilerun({
              apiKey: process.env['MOBILERUN_CLOUD_API_KEY'], // This is the default and can be omitted
            });

            const response = await client.assistant.conversations.history({
              sessionId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
            });

            console.log(response.messages);
        - lang: Python
          source: |-
            import os
            from mobilerun_sdk import Mobilerun

            client = Mobilerun(
                api_key=os.environ.get("MOBILERUN_CLOUD_API_KEY"),  # This is the default and can be omitted
            )
            response = client.assistant.conversations.history(
                session_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
            )
            print(response.messages)
components:
  securitySchemes:
    bearerAuth:
      bearerFormat: Opaque
      description: Bearer token via Authorization header
      scheme: bearer
      type: http

````