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

# Upload an image, video, audio or document. You can use the return object directly when creating a new message.

> An internal UUID will be generated. This UUID will be used instead of providing a public URL to a file.
When you set public to true, you can use the URL field, which is reachable from public, for use in Whatsapp templates.
Depending on the given type, mime type validation will take place.
File will be stored for a maximum of 90 days.
Special: images will be downsized to 1500px (each side, respecting aspect ratio) to maintain file size limits
when sending to external services (e.g. WhatsApp limits images to 5MB).
Special: videos of type video/quicktime (usually from iOS) will be converted to mp4.




## OpenAPI

````yaml /openapi/chat-client.yaml post /files/temporary-upload
openapi: 3.0.3
info:
  version: 1.0.0
  title: HealviChat Client API
servers:
  - url: https://{tenant_domain}/third-party/v1
    variables:
      tenant_domain:
        default: your-tenant.onhealvi.com
        description: Your tenant domain
security:
  - bearerAuth: []
paths:
  /files/temporary-upload:
    post:
      tags:
        - files
      summary: >-
        Upload an image, video, audio or document. You can use the return object
        directly when creating a new message.
      description: >
        An internal UUID will be generated. This UUID will be used instead of
        providing a public URL to a file.

        When you set public to true, you can use the URL field, which is
        reachable from public, for use in Whatsapp templates.

        Depending on the given type, mime type validation will take place.

        File will be stored for a maximum of 90 days.

        Special: images will be downsized to 1500px (each side, respecting
        aspect ratio) to maintain file size limits

        when sending to external services (e.g. WhatsApp limits images to 5MB).

        Special: videos of type video/quicktime (usually from iOS) will be
        converted to mp4.
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                type:
                  type: string
                  enum:
                    - image
                    - video
                    - audio
                    - document
                public:
                  description: >
                    Optional flag to indicate if the file should be publicly
                    accessible permanently.

                    Use it for WhatsApp campaigns or template sending.

                    Does not work when using the messages endpoint.

                    Only use for files that are not sensitive as anyone with the
                    URL can access the file.
                  type: integer
                  example: 1
                file:
                  type: string
                  format: binary
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  internal_uuid:
                    description: >-
                      Internal identifier which will be used when creating a new
                      message.
                    type: string
                  public:
                    type: boolean
                    description: |
                      When public, returned URL is valid as long file exists.
                      When not public, URL will be temporary signed URL.
                  url:
                    description: Public reachable URL.
                    type: string
                  name:
                    description: Name of uploaded file.
                    type: string
                  type:
                    description: Type of uploaded file (specified on upload).
                    type: string
                  mime_type:
                    description: Mime type of uploaded file.
                    type: string
                  size:
                    description: Size in bytes of uploaded file.
                    type: integer
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````