> ## 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 Space Messages



## OpenAPI

````yaml get /v1/spaces/{space_id}/messages
openapi: 3.0.2
info:
  title: Duplik Backend
  description: The API for Duplik Backend.
  version: 0.1.0
servers:
  - url: https://api.duplik.cn
security: []
paths:
  /v1/spaces/{space_id}/messages:
    get:
      tags:
        - openapi-space
      summary: Get Space Messages
      operationId: get_space_messages_v1_spaces__space_id__messages_get
      parameters:
        - required: true
          schema:
            title: Space Id
            type: integer
          name: space_id
          in: path
        - description: external user id
          required: false
          schema:
            title: External User Id
            type: string
            description: external user id
          name: external_user_id
          in: query
        - required: false
          schema:
            title: Page Num
            type: integer
            default: 1
          name: page_num
          in: query
        - required: false
          schema:
            title: Page Size
            type: integer
            default: 100
          name: page_size
          in: query
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SpaceConversationMessagePagination'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: Unprocessable Entity
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - HTTPBearer: []
components:
  schemas:
    SpaceConversationMessagePagination:
      title: SpaceConversationMessagePagination
      type: object
      properties:
        total_count:
          title: Total Count
          type: integer
          default: 0
        total_page:
          title: Total Page
          type: integer
          default: 0
        page_num:
          title: Page Num
          type: integer
          default: 1
        page_size:
          title: Page Size
          type: integer
          default: 10
        items:
          title: Items
          type: array
          items:
            $ref: '#/components/schemas/ConversationMessageRead'
          default: []
    ErrorResponse:
      title: ErrorResponse
      required:
        - code
        - message
      type: object
      properties:
        code:
          title: Code
          type: integer
        message:
          title: Message
          type: string
    ConversationMessageRead:
      title: ConversationMessageRead
      required:
        - space_id
        - user_id
        - session_id
        - conversation_id
        - message_id
      type: object
      properties:
        created_at:
          title: Created At
          type: integer
        updated_at:
          title: Updated At
          type: integer
        source:
          title: Source
          type: integer
          default: 1
        space_id:
          title: Space Id
          type: string
        user_id:
          title: User Id
          type: string
        external_user_id:
          title: External User Id
          type: string
        session_id:
          title: Session Id
          type: string
        conversation_id:
          title: Conversation Id
          type: integer
        user_message:
          title: User Message
          maxLength: 4096
          type: string
          default: ''
        assistant_message:
          title: Assistant Message
          maxLength: 4096
          type: string
          default: ''
        suggested_questions:
          title: Suggested Questions
          type: array
          items:
            type: string
          default: []
        total_tokens:
          title: Total Tokens
          type: integer
          default: 0
        prompt_tokens:
          title: Prompt Tokens
          type: integer
          default: 0
        completion_tokens:
          title: Completion Tokens
          type: integer
          default: 0
        successful_requests:
          title: Successful Requests
          type: integer
          default: 0
        status:
          title: Status
          type: integer
          default: 1
        message_id:
          title: Message Id
          type: string
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````