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

# Retrieve Session Thread Messages

> Retrieves messages for a given session thread.

Get messages from a session thread.


## OpenAPI

````yaml GET /api/assistants/threads/{threadId}/messages
openapi: 3.1.0
info:
  title: Session Thread API
  description: API for managing session threads.
  license:
    name: MIT
    identifier: ''
  version: 1.0.0
servers:
  - url: https://agent-service-511985928315.us-east4.run.app
security:
  - bearerAuth: []
    XEnvoleUserId: []
paths:
  /api/assistants/threads/{threadId}/messages:
    get:
      summary: Retrieve session thread messages
      description: Retrieves messages for a given session thread.
      parameters:
        - name: threadId
          in: path
          required: true
          schema:
            type: string
        - name: maxResults
          in: query
          required: false
          schema:
            type: integer
      responses:
        '200':
          description: A list of session thread messages.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/SessionThreadMessagesResp'
              example:
                - id: msg_122
                  role: user
                  content: >-
                    Can you send an email to john@company.com about the project
                    status update?
                  timestamp: '2024-01-01T11:59:00Z'
                - id: msg_123
                  handle: '@project_manager'
                  role: assistant
                  content: >-
                    I'll send an email to john@company.com with the project
                    status update. Let me compose and send that for you.
                  toolExecutionHumanApprovalRequest:
                    - toolId: tool_456
                      name: gmail_send_email
                      provider: GMAIL
                      category: EMAIL
                      toolExecutionId: exec_789
                      executionBatchId: batch_101
                      toolArguments:
                        to: john@company.com
                        subject: Project Status Update
                        body: |-
                          Hi John,

                          Here's the latest project status update...
                        from: assistant@company.com
                      status: PENDING_HUMAN_APPROVAL
                  timestamp: '2024-01-01T12:00:00Z'
        '204':
          description: No content.
        '400':
          description: Bad request.
        '500':
          description: Internal server error.
components:
  schemas:
    SessionThreadMessagesResp:
      type: object
      properties:
        id:
          type: string
        handle:
          type: string
        role:
          type: string
          enum:
            - user
            - assistant
            - system
        content:
          type: string
        toolExecutionHumanApprovalRequest:
          type: array
          items:
            $ref: '#/components/schemas/ToolExecutionHumanApprovalData'
        timestamp:
          type: string
          format: date-time
      example:
        messageId: msg_123
        threadId: thread_456
        role: user
        content: Hi what can you do for me
        createdAt: '2024-01-01T12:00:00Z'
    ToolExecutionHumanApprovalData:
      type: object
      properties:
        toolId:
          type: string
        name:
          type: string
        provider:
          type: string
        category:
          type: string
        toolExecutionId:
          type: string
        executionBatchId:
          type: string
        toolArguments:
          type: object
          additionalProperties:
            type: string
        status:
          $ref: '#/components/schemas/ToolExecutionHumanApprovalStatus'
      required:
        - toolId
        - name
        - provider
        - category
        - toolExecutionId
        - executionBatchId
        - toolArguments
        - status
    ToolExecutionHumanApprovalStatus:
      type: string
      enum:
        - PENDING_HUMAN_APPROVAL
        - APPROVED
        - DENIED
        - ABORTED_WITH_FEEDBACK
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
    XEnvoleUserId:
      type: apiKey
      in: header
      name: X-Envole-User-Id
      description: External user identifier; not necessarily registered with Envole

````