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

# Upload file

> Uploads a file to the server as a temporary file. It returns a URL that expires after 24 hours unless the URL is used in `send_event`.

`incoming_event` returns a URL that never expires.



## OpenAPI

````yaml /api/customer-chat/v3.7/openapi.json post /action/upload_file
openapi: 3.1.0
info:
  title: Customer Chat API
  version: '3.7'
servers:
  - url: https://api.livechatinc.com/v3.7/customer
security:
  - CustomerBearerToken: []
tags:
  - name: Chats
  - name: Configuration
  - name: Events
  - name: Localization
  - name: Properties
  - name: Customers
  - name: Status
  - name: Other
paths:
  /action/upload_file:
    post:
      tags:
        - Events
      summary: Upload file
      description: >-
        Uploads a file to the server as a temporary file. It returns a URL that
        expires after 24 hours unless the URL is used in `send_event`.


        `incoming_event` returns a URL that never expires.
      operationId: upload-file
      parameters:
        - $ref: '#/components/parameters/organization_id'
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              required:
                - file
              properties:
                file:
                  type: string
                  format: binary
                  description: 'Maximum size: 10MB. Executable files are rejected.'
      responses:
        '200':
          description: File uploaded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UploadFileResponse'
              example:
                url: >-
                  https://cdn.livechat-files.com/api/file/lc/att/8948324/45a3581b59a7295145c3825c86ec7ab3/image.png
components:
  parameters:
    organization_id:
      name: organization_id
      in: query
      required: true
      schema:
        type: string
      description: Unique identifier of the organization.
  schemas:
    UploadFileResponse:
      type: object
      properties:
        url:
          type: string
          description: The URL of the uploaded file.
  securitySchemes:
    CustomerBearerToken:
      type: http
      scheme: bearer
      description: >-
        Customer access token obtained from the [customer authorization
        flow](/authentication/customer-tokens).
      x-example: us-south1:MQraNrGCsoJvtxD7KNJQB1kM3d5

````