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

# Duplicate Message

> Duplicate an existing message. Message must be from agent. Can be used to retry a failed message. New message will be sent immediately. When message was based on a WhatsApp template, the template itself will not be used. Instead, the compiled message will be sent as a regular (e.g. text) message.



## OpenAPI

````yaml api-reference/openapi.json post /conversations/{conversationId}/messages/{messageId}/duplicate
openapi: 3.0.3
info:
  version: 0.1.0
  title: Client API
servers:
  - url: https://1-some-client.some-server.healvi-chat/third-party/v1
security:
  - bearerAuth: []
paths:
  /conversations/{conversationId}/messages/{messageId}/duplicate:
    post:
      tags:
        - messages
      summary: >
        Duplicate an existing message. Message must be from agent. Can be used
        to retry a failed message.

        New message will be sent immediately. When message was based on a
        WhatsApp template,

        the template itself will not be used. Instead, the compiled message will
        be sent

        as a regular (e.g. text) message.
      parameters:
        - in: path
          name: conversationId
          schema:
            type: integer
          required: true
        - in: path
          name: messageId
          schema:
            type: integer
          required: true
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/Message'
components:
  schemas:
    Message:
      description: A message within a conversation.
      type: object
      properties:
        id:
          type: integer
          description: Internal ID.
        conversation_id:
          type: integer
          description: Foreign ID of related conversation.
        from:
          $ref: '#/components/schemas/MessageFrom'
        source:
          $ref: '#/components/schemas/MessageSource'
        user_id:
          description: Id of user who created this message.
          type: integer
          nullable: true
        contents:
          description: >
            A message can contain multiple contents when receiving.

            Usually it is just one item. For example when sending multiple

            contacts with WhatsApp, it will generate one message with multiple

            contacts within the contents array. When sending, only one item in
            the

            array is allowed.
          type: array
          items:
            anyOf:
              - $ref: '#/components/schemas/TextMessageContent'
              - $ref: '#/components/schemas/ImageMessageContent'
              - $ref: '#/components/schemas/VideoMessageContent'
              - $ref: '#/components/schemas/AudioMessageContent'
              - $ref: '#/components/schemas/DocumentMessageContent'
              - $ref: '#/components/schemas/LocationMessageContent'
              - $ref: '#/components/schemas/ContactMessageContent'
            minLength: 1
        status:
          $ref: '#/components/schemas/MessageStatus'
        agent_reaction:
          description: String containing a single emoji.
          type: string
          nullable: true
        customer_reaction:
          description: String containing a single emoji.
          type: string
          nullable: true
        sent_at:
          description: Datetime when message was sent.
          type: string
          format: date-time
          nullable: true
          example: '2023-01-01T12:00:00Z'
        reference:
          description: Reference of a message within the same conversation
          allOf:
            - $ref: '#/components/schemas/Message'
          nullable: true
        latest_error:
          description: Contains the latest error if something went wrong.
          allOf:
            - $ref: '#/components/schemas/MessageError'
          nullable: true
        whatsapp_campaign:
          description: >-
            If "source" is "whatsapp-campaign" then this will be the campaign
            which created this message.
          allOf:
            - $ref: '#/components/schemas/WhatsappCampaign'
          nullable: true
    MessageFrom:
      description: Who wrote the message.
      type: string
      enum:
        - system
        - agent
        - customer
    MessageSource:
      description: What triggered the message.
      type: string
      enum:
        - user
        - whatsapp-campaign
    TextMessageContent:
      description: Simple message content containing text.
      type: object
      properties:
        type:
          type: string
          enum:
            - text
        content:
          description: The content of the text message.
          type: string
    ImageMessageContent:
      description: Message content containing an image.
      allOf:
        - $ref: '#/components/schemas/FileMessageContent'
        - type: object
          properties:
            type:
              type: string
              enum:
                - image
            caption:
              description: Caption of image.
              type: string
              nullable: true
    VideoMessageContent:
      description: Message content containing a video.
      allOf:
        - $ref: '#/components/schemas/FileMessageContent'
        - type: object
          properties:
            type:
              type: string
              enum:
                - video
            caption:
              description: Caption of video.
              type: string
              nullable: true
    AudioMessageContent:
      description: Message content containing an audio recording.
      allOf:
        - $ref: '#/components/schemas/FileMessageContent'
        - type: object
          properties:
            type:
              type: string
              enum:
                - audio
            voice:
              description: True if audio is a voice recording.
              type: boolean
    DocumentMessageContent:
      description: Message content containing a document.
      allOf:
        - $ref: '#/components/schemas/FileMessageContent'
        - type: object
          properties:
            type:
              type: string
              enum:
                - document
            filename:
              description: Name of document.
              type: string
              nullable: true
            caption:
              description: Caption of document.
              type: string
              nullable: true
    LocationMessageContent:
      description: Message content containing a GPS location.
      type: object
      properties:
        type:
          type: string
          enum:
            - location
        latitude:
          type: string
        longitude:
          type: string
        address:
          type: string
          nullable: true
        name:
          description: Name of the place.
          type: string
          nullable: true
        url:
          type: string
          nullable: true
    ContactMessageContent:
      description: Message content containing a contact.
      type: object
      required:
        - name
      properties:
        type:
          type: string
          enum:
            - contact
        name:
          type: object
          required:
            - formatted_name
            - first_name
          properties:
            formatted_name:
              type: string
            first_name:
              type: string
              nullable: true
            middle_name:
              type: string
              nullable: true
            last_name:
              type: string
              nullable: true
            prefix:
              type: string
              nullable: true
            suffix:
              type: string
              nullable: true
        birthday:
          type: string
          format: date
          nullable: true
          example: '1970-01-01T00:00:00.000Z'
        phones:
          type: array
          items:
            type: object
            properties:
              phone:
                type: string
              type:
                type: string
        emails:
          type: array
          items:
            type: object
            properties:
              email:
                type: string
              type:
                type: string
        addresses:
          type: array
          items:
            type: object
            properties:
              street:
                type: string
              city:
                type: string
              state:
                type: string
              zip:
                type: string
              country:
                type: string
              country_code:
                type: string
              type:
                type: string
        org:
          type: object
          properties:
            company:
              type: string
            department:
              type: string
            title:
              type: string
    MessageStatus:
      description: >-
        Status of message. Created messages have not been sent yet via external
        API.
      type: string
      enum:
        - created
        - sent
        - delivered
        - read
        - error
    MessageError:
      description: Error description when something went wrong sending/receiving a message.
      type: object
      properties:
        id:
          type: integer
          description: Internal ID.
        message_id:
          type: integer
          description: Foreign ID of related message.
        type:
          type: string
          enum:
            - status-update
            - other
        original_message:
          description: Error message from bridge or messenger service.
          type: string
        created_at:
          description: Datetime when error was created.
          type: string
          format: date-time
          nullable: true
          example: '2023-01-01T12:00:00Z'
    WhatsappCampaign:
      description: WhatsApp campaign (marketing).
      type: object
      properties:
        id:
          type: integer
          description: Internal ID.
        name:
          description: Name of campaign.
          type: string
    FileMessageContent:
      description: Base object for message content having a file.
      type: object
      properties:
        has_file:
          type: boolean
          enum:
            - true
        uuid:
          description: Unique UUID of file. Used to retrieve file data from server.
          type: string
        name:
          description: Name of file.
          nullable: true
        mime_type:
          description: Type of file.
          type: string
          example: audio/ogg
        size:
          description: Size of file in bytes.
          type: integer
        download_url:
          description: URL to directly download the file. Token still needed.
          type: string
        public_download_url:
          description: >-
            URL to directly download the file without a token. Use at your own
            risk.
          type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````