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

# Upload file attachments

> Post the necessary fields for the API to upload files. The files need to be a buffer with the key "fileAttachment". <br /><br /> The allowed file types are: <br/> <ul><li>JPG</li><li>JPEG</li><li>PNG</li><li>MP4</li><li>MPEG</li><li>ZIP</li><li>RAR</li><li>PDF</li><li>DOC</li><li>DOCX</li><li>TXT</li><li>MP3</li><li>WAV</li></ul> <br /><br /> The API will return an object with the URLs



## OpenAPI

````yaml /api-reference/conversations/openapi.json post /conversations/messages/upload
openapi: 3.0.0
info:
  title: Conversations API
  description: Documentation for Conversations API
  version: '1.0'
  contact: {}
servers:
  - url: https://services.leadconnectorhq.com
security: []
tags:
  - name: Conversations
    description: Documentation for Conversations API
  - name: Search
    description: Documentation for Conversations API
  - name: Email
    description: Documentation for Conversations API
  - name: Messages
    description: Documentation for Conversations API
  - name: Providers
    description: Documentation for Conversations API
paths:
  /conversations/messages/upload:
    post:
      tags:
        - Messages
      summary: Upload file attachments
      description: >-
        Post the necessary fields for the API to upload files. The files need to
        be a buffer with the key "fileAttachment". <br /><br /> The allowed file
        types are: <br/>
        <ul><li>JPG</li><li>JPEG</li><li>PNG</li><li>MP4</li><li>MPEG</li><li>ZIP</li><li>RAR</li><li>PDF</li><li>DOC</li><li>DOCX</li><li>TXT</li><li>MP3</li><li>WAV</li></ul>
        <br /><br /> The API will return an object with the URLs
      operationId: upload-file-attachments
      parameters:
        - name: Version
          in: header
          description: API Version
          required: true
          schema:
            type: string
            enum:
              - '2021-04-15'
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/UploadFilesDto'
      responses:
        '200':
          description: Uploaded the file successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UploadFilesResponseDto'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestDTO'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedDTO'
        '413':
          description: Payload Too Large
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UploadFilesErrorResponseDto'
        '415':
          description: Unsupported Media Type
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UploadFilesErrorResponseDto'
      security:
        - bearer:
            - conversations/message.write
components:
  schemas:
    UploadFilesDto:
      type: object
      properties:
        conversationId:
          type: string
          description: Conversation Id
          example: ve9EPM428h8vShlRW1KT
        locationId:
          type: string
        attachmentUrls:
          type: array
          items:
            type: string
      required:
        - conversationId
        - locationId
        - attachmentUrls
    UploadFilesResponseDto:
      type: object
      properties:
        uploadedFiles:
          type: object
      required:
        - uploadedFiles
    BadRequestDTO:
      type: object
      properties:
        statusCode:
          type: number
          example: 400
        message:
          type: string
          example: Bad Request
      required:
        - statusCode
        - message
    UnauthorizedDTO:
      type: object
      properties:
        statusCode:
          type: number
          example: 401
        message:
          type: string
          example: 'Invalid token: access token is invalid'
        error:
          type: string
          example: Unauthorized
      required:
        - statusCode
        - message
        - error
    UploadFilesErrorResponseDto:
      type: object
      properties:
        status:
          type: number
          description: HTTP Status code of the request
          example: 413
          enum:
            - 400
            - 413
            - 415
        message:
          type: string
          description: Error message of the request
          example: Failed to upload the files
      required:
        - status
        - message
  securitySchemes:
    bearer:
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Use the Access Token generated with user type as Sub-Account (OR)
        Private Integration Token of Sub-Account.
      type: http

````