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

# Save Chatbot Conversation

> Save a chatbot conversation.



## OpenAPI

````yaml /api-reference/v1.json post /v1/conversation
openapi: 3.0.0
info:
  title: Droxy API
  description: ''
  version: '1.0'
  contact: {}
servers:
  - url: https://api.droxy.ai
security: []
tags: []
paths:
  /v1/conversation:
    post:
      tags:
        - Conversation
      summary: Save Chatbot Conversation
      description: Save a chatbot conversation.
      operationId: ApiConversationController_saveConversation
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApiSaveConversationDto'
      responses:
        '200':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiConversationDto'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponseDto'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponseDto'
        '404':
          description: Element not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponseDto'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponseDto'
      security:
        - x-api-key: []
components:
  schemas:
    ApiSaveConversationDto:
      type: object
      properties:
        conversationId:
          type: string
          description: >-
            The conversation's id. If not defined, a new conversation will be
            created.
        chatbotId:
          type: string
          description: The chatbot's id to associate the conversation with.
        messages:
          description: An array of messages to save in the conversation.
          type: array
          items:
            $ref: '#/components/schemas/ChatMessageDto'
        override:
          type: boolean
          description: >-
            The conversation's override flag. If true, the conversation will be
            overridden. If false, the conversation will be appended to the
            existing conversation. Will default to true.
      required:
        - chatbotId
        - messages
    ApiConversationDto:
      type: object
      properties:
        id:
          type: string
          description: The conversation id.
        user:
          type: string
          description: The user id associated to the conversation.
        chatbot:
          type: string
          description: The chatbot id associated to the conversation .
        createdAt:
          type: number
          description: >-
            The created date of the conversation. Unix timestamp in
            milliseconds.
        messages:
          description: The array of messages for the conversation.
          type: array
          items:
            $ref: '#/components/schemas/ApiChatMessageDto'
        source:
          description: The conversation's source.
          allOf:
            - $ref: '#/components/schemas/ConversationSource'
      required:
        - id
        - user
        - chatbot
        - createdAt
        - messages
        - source
    ApiErrorResponseDto:
      type: object
      properties:
        statusCode:
          type: number
          description: Error status code.
        message:
          description: Error message or an array of error messages.
          type: array
          items:
            type: string
        error:
          type: string
          description: Source of the error.
      required:
        - statusCode
        - message
        - error
    ChatMessageDto:
      type: object
      properties: {}
    ApiChatMessageDto:
      type: object
      properties:
        text:
          type: string
          description: The message's text.
        fromUser:
          type: boolean
          description: If the message is from the user.
      required:
        - text
        - fromUser
    ConversationSource:
      type: object
      properties:
        type:
          type: string
          description: >-
            The conversation source type. Values can be 'app', 'website',
            'link', 'discord', 'zapier', 'whatsapp' or 'api'.
        discordChannelId:
          type: string
          description: >-
            The discord channel id. Defined only if the conversation source type
            is 'discord'.
        whatsAppInfo:
          description: >-
            The phone number info. Defined only if the conversation source type
            is 'whatsapp'.
          allOf:
            - $ref: '#/components/schemas/WhatsAppConversationInfo'
        facebookInfo:
          description: >-
            The facebook info. Defined only if the conversation source type is
            'facebook'.
          allOf:
            - $ref: '#/components/schemas/FacebookConversationInfo'
        instagramInfo:
          description: >-
            The instagram info. Defined only if the conversation source type is
            'instagram'.
          allOf:
            - $ref: '#/components/schemas/InstagramConversationInfo'
      required:
        - type
        - discordChannelId
        - whatsAppInfo
        - facebookInfo
        - instagramInfo
    WhatsAppConversationInfo:
      type: object
      properties:
        replyingPhoneNumberId:
          type: string
          description: >-
            The unique identifier for the phone number used to reply to the
            user.
        replyingPhoneNumber:
          type: string
          description: The formatted phone number used to reply to the user.
        senderPhoneNumber:
          type: string
          description: The phone number of the user who sent the message.
        senderName:
          type: string
          description: The name of the user who sent the message.
      required:
        - replyingPhoneNumberId
        - replyingPhoneNumber
        - senderPhoneNumber
        - senderName
    FacebookConversationInfo:
      type: object
      properties:
        pageId:
          type: string
          description: The facebook page id.
        senderId:
          type: string
          description: The facebook sender id.
        senderName:
          type: string
          description: The facebook sender name.
      required:
        - pageId
        - senderId
        - senderName
    InstagramConversationInfo:
      type: object
      properties:
        instagramAccountId:
          type: string
          description: The instagram account id.
        senderId:
          type: string
          description: The instagram sender id.
        senderUsername:
          type: string
          description: The instagram sender username.
        senderName:
          type: string
          description: The instagram sender name.
      required:
        - instagramAccountId
        - senderId
        - senderUsername
  securitySchemes:
    x-api-key:
      type: apiKey
      in: header
      name: x-api-key

````