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

> 获取一个对话消息

# Get Conversation Messages Pagination



## OpenAPI

````yaml get /v1/conversations/{conversation_id}/messages
openapi: 3.1.0
info:
  title: spectra-server
  description: The API for Spectra Backend.
  version: 0.1.0
servers:
  - url: https://api-spectra.duplik.cn
security: []
paths:
  /v1/conversations/{conversation_id}/messages:
    get:
      tags:
        - Conversations
      summary: Get Conversation Messages Pagination
      operationId: >-
        get_conversation_messages_pagination_v1_conversations__conversation_id__messages_get
      parameters:
        - name: conversation_id
          in: path
          required: true
          schema:
            type: string
            title: Conversation Id
        - name: page_num
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
            default: 1
            title: Page Num
        - name: page_size
          in: query
          required: false
          schema:
            type: integer
            maximum: 1000
            minimum: 1
            default: 10
            title: Page Size
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConversationMessagePaginationResponse'
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Bad Request
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Unprocessable Entity
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Internal Server Error
      security:
        - HTTPBearer: []
components:
  schemas:
    ConversationMessagePaginationResponse:
      properties:
        total_count:
          type: integer
          title: Total Count
          default: 0
        total_page:
          type: integer
          title: Total Page
          default: 0
        page_num:
          type: integer
          title: Page Num
          default: 1
        page_size:
          type: integer
          title: Page Size
          default: 10
        items:
          items:
            $ref: '#/components/schemas/ConversationMessageDetailRead'
          type: array
          title: Items
      type: object
      required:
        - items
      title: ConversationMessagePaginationResponse
      description: Conversation message pagination response model
    ErrorResponse:
      properties:
        code:
          type: integer
          title: Code
        message:
          type: string
          title: Message
      type: object
      required:
        - code
        - message
      title: ErrorResponse
    ConversationMessageDetailRead:
      properties:
        created_at:
          anyOf:
            - type: integer
            - type: 'null'
          title: Created At
        updated_at:
          anyOf:
            - type: integer
            - type: 'null'
          title: Updated At
        org_id:
          type: string
          title: Org Id
        user_id:
          type: string
          title: User Id
        conversation_id:
          anyOf:
            - type: string
              maxLength: 20
            - type: 'null'
          title: Conversation Id
          description: Conversation ID
        user_message:
          type: string
          maxLength: 4096
          title: User Message
          description: User message
          default: ''
        file_ids:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: File Ids
          description: User attachment files
        assistant_message:
          type: string
          title: Assistant Message
          description: Assistant message
        assistant_message_id:
          type: string
          maxLength: 32
          title: Assistant Message Id
          description: Assistant message ID
          default: ''
        suggested_questions:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Suggested Questions
          description: Suggested questions
        status:
          type: integer
          title: Status
          description: Message status
          default: 1
        star:
          type: boolean
          title: Star
          description: Star status
          default: false
        message_id:
          type: string
          title: Message Id
        user_files:
          items:
            $ref: '#/components/schemas/SimpleFile'
          type: array
          title: User Files
          description: User uploaded files
          default: []
        agent_events:
          items:
            $ref: '#/components/schemas/ConversationEventRead'
          type: array
          title: Agent Events
          description: Agent events
          default: []
      type: object
      required:
        - created_at
        - updated_at
        - org_id
        - user_id
        - assistant_message
        - message_id
      title: ConversationMessageDetailRead
      description: Conversation message detail read model
    SimpleFile:
      properties:
        file_id:
          anyOf:
            - type: string
            - type: 'null'
          title: File Id
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
        location:
          anyOf:
            - type: string
            - type: 'null'
          title: Location
        path:
          anyOf:
            - type: string
            - type: 'null'
          title: Path
        type:
          anyOf:
            - type: string
            - type: 'null'
          title: Type
        size:
          anyOf:
            - type: integer
            - type: 'null'
          title: Size
      type: object
      title: SimpleFile
    ConversationEventRead:
      properties:
        created_at:
          anyOf:
            - type: integer
            - type: 'null'
          title: Created At
        updated_at:
          anyOf:
            - type: integer
            - type: 'null'
          title: Updated At
        org_id:
          type: string
          title: Org Id
        user_id:
          type: string
          title: User Id
        conversation_id:
          anyOf:
            - type: string
              maxLength: 20
            - type: 'null'
          title: Conversation Id
          description: Conversation ID
        message_id:
          anyOf:
            - type: string
              maxLength: 20
            - type: 'null'
          title: Message Id
          description: Message ID
        event_type:
          type: string
          maxLength: 16
          title: Event Type
          description: Event type
          default: ''
        event_message_id:
          type: string
          maxLength: 32
          title: Event Message Id
          description: Event message ID
          default: ''
        event_message:
          anyOf:
            - type: string
            - type: 'null'
          title: Event Message
          description: Event message
        event_extra:
          anyOf:
            - type: object
            - type: 'null'
          title: Event Extra
          description: Event extra data
        status:
          type: integer
          title: Status
          description: Event status
          default: 1
        agent_type:
          anyOf:
            - type: string
            - type: 'null'
          title: Agent Type
          default: ''
        event_id:
          type: string
          title: Event Id
      type: object
      required:
        - created_at
        - updated_at
        - org_id
        - user_id
        - event_message
        - event_id
      title: ConversationEventRead
      description: Conversation event read model
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````