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

# Get messages



## OpenAPI

````yaml /openapi/assistant.json get /v1/assistant/sessions/{id}/messages/
openapi: 3.0.3
info:
  title: Yume API — AI Ассистент
  version: 1.0.0
  description: SSE чат-шлюз и инструменты ассистента.
servers:
  - url: https://api.yume.cloud
    description: Production
  - url: https://api.stage.yume.cloud
    description: Stage
security: []
paths:
  /v1/assistant/sessions/{id}/messages/:
    get:
      tags:
        - sessions
      summary: Get messages
      operationId: sessions_messages_list
      parameters:
        - in: path
          name: id
          schema:
            type: string
            format: uuid
          required: true
        - $ref: '#/components/parameters/TenantId'
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/SessionMessage'
          description: ''
      security:
        - jwtAuth: []
components:
  parameters:
    TenantId:
      name: X-Tenant-Id
      in: header
      required: false
      schema:
        type: integer
      description: >-
        Компания, в контексте которой выполняется запрос — её id из `GET
        /v1/tenant/`. Пользователь должен состоять в этой компании: чужой id
        доступа к данным не даёт. Без заголовка компания определяется по домену
        запроса.
  schemas:
    SessionMessage:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        user_id:
          type: integer
          nullable: true
          readOnly: true
        role:
          allOf:
            - $ref: '#/components/schemas/RoleEnum'
          readOnly: true
        provider_name:
          type: string
          readOnly: true
        model_name:
          type: string
          readOnly: true
        input:
          type: integer
          readOnly: true
        output:
          type: integer
          readOnly: true
        cache_write:
          type: integer
          readOnly: true
        cache_read:
          type: integer
          readOnly: true
        created_at:
          type: string
          format: date-time
          readOnly: true
        parts:
          type: array
          items:
            $ref: '#/components/schemas/SessionMessagePart'
          readOnly: true
      required:
        - cache_read
        - cache_write
        - created_at
        - id
        - input
        - model_name
        - output
        - parts
        - provider_name
        - role
        - user_id
    RoleEnum:
      enum:
        - user
        - assistant
        - system
        - tool
      type: string
      description: |-
        * `user` - Пользователь
        * `assistant` - Ассистент
        * `system` - Система
        * `tool` - Инструмент
    SessionMessagePart:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        order:
          type: integer
          readOnly: true
        kind:
          allOf:
            - $ref: '#/components/schemas/KindEnum'
          readOnly: true
        content:
          type: string
          readOnly: true
          description: >-
            Text content for text/thinking/user-prompt/system-prompt parts, or
            the (JSON-encoded, if non-string) tool return/retry content.
        text:
          type: string
          readOnly: true
        tool_call_id:
          type: string
          readOnly: true
        tool_name:
          type: string
          readOnly: true
        args:
          readOnly: true
          nullable: true
          description: Arguments of a tool-call part.
        attachments:
          type: string
          readOnly: true
        created_at:
          type: string
          format: date-time
          readOnly: true
      required:
        - args
        - attachments
        - content
        - created_at
        - id
        - kind
        - order
        - text
        - tool_call_id
        - tool_name
    KindEnum:
      enum:
        - system-prompt
        - user-prompt
        - tool-return
        - retry-prompt
        - text
        - thinking
        - compaction
        - tool-call
        - builtin-tool-call
        - builtin-tool-return
        - file
      type: string
      description: |-
        * `system-prompt` - Системный промпт
        * `user-prompt` - Запрос пользователя
        * `tool-return` - Ответ инструмента
        * `retry-prompt` - Повторный запрос
        * `text` - Текст
        * `thinking` - Размышления
        * `compaction` - Сжатие контекста
        * `tool-call` - Вызов инструмента
        * `builtin-tool-call` - Вызов встроенного инструмента
        * `builtin-tool-return` - Ответ встроенного инструмента
        * `file` - Файл
  securitySchemes:
    jwtAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````