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

# Get conversation history

> Get the message history for a conversation



## OpenAPI

````yaml openapi.json get /api/v1/ai/conversations/history
openapi: 3.0.0
info:
  description: Dualship backend API for workflow automation and API management.
  title: Dualship API
  termsOfService: https://dualship.run/terms
  contact:
    name: Dualship Support
    url: https://dualship.run/support
    email: support@dualship.run
  version: '1.0'
servers:
  - url: https://api.dualship.run
security: []
paths:
  /api/v1/ai/conversations/history:
    get:
      tags:
        - ai
      summary: Get conversation history
      description: Get the message history for a conversation
      parameters:
        - description: Workspace ID
          name: X-Workspace-Id
          in: header
          required: true
          schema:
            type: string
        - description: Conversation ID
          name: conversation_id
          in: query
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Conversation history
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/internal_api_handler.ConversationHistoryResponse
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/internal_api_handler.BadRequestError'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/internal_api_handler.UnauthorizedError'
        '500':
          description: Failed to get history
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/internal_api_handler.InternalServerError'
        '503':
          description: AI service not configured
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/internal_api_handler.ServiceUnavailableError
      security:
        - BearerAuth: []
components:
  schemas:
    internal_api_handler.ConversationHistoryResponse:
      description: Conversation history response
      type: object
      properties:
        conversation_id:
          type: string
          example: conv_abc123
        messages:
          type: array
          items:
            $ref: '#/components/schemas/internal_api_handler.HistoryMessage'
    internal_api_handler.BadRequestError:
      description: Bad request error
      type: object
      properties:
        code:
          type: string
          example: BAD_REQUEST
        error:
          type: string
          example: invalid request parameters
    internal_api_handler.UnauthorizedError:
      description: Unauthorized error
      type: object
      properties:
        code:
          type: string
          example: UNAUTHORIZED
        error:
          type: string
          example: unauthorized
    internal_api_handler.InternalServerError:
      description: Internal server error
      type: object
      properties:
        code:
          type: string
          example: INTERNAL_ERROR
        error:
          type: string
          example: internal server error
    internal_api_handler.ServiceUnavailableError:
      description: Service unavailable error
      type: object
      properties:
        code:
          type: string
          example: SERVICE_UNAVAILABLE
        error:
          type: string
          example: service unavailable
    internal_api_handler.HistoryMessage:
      description: History message
      type: object
      properties:
        content:
          type: string
          example: Hello, how can you help me?
        role:
          type: string
          example: user
        timestamp:
          type: string
          example: '2024-01-15T10:00:00Z'
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: JWT Bearer token authentication

````