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

# Upload a file

> Upload a file.



## OpenAPI

````yaml /openapi-specs/lucca-files.yaml post /lucca-files/api/uploads
openapi: 3.1.0
info:
  title: Lucca.Files
  version: '1.0'
  description: |
    Welcome on the documentation for the Lucca Files API.
  contact:
    name: API Support
    url: https://support.lucca.fr
    email: contact@luccasoftware.com
  license:
    name: Unlicensed
    url: https://www.luccasoftware.com
servers:
  - url: https://{host}
    description: Your Lucca account URL.
    variables:
      host:
        default: example.ilucca.net
        description: >-
          The URL of your dedicated Lucca account: `{account}.{env}.{region}`.


          Account reflects your company name. Env indicates the environment.
          Region depends on your server location.


          **Please, use your test or sandbox environments (and not your
          production env.) for testing purposes.**


          Environments:

          - `ilucca`: production environment for customers.

          - `ilucca-test`: test environment for customers.

          - `ilucca-demo`: demo environment for prospects.


          Regions:

          - `.ch` for Swiss located accounts.

          - `.net` for the others.


          Regarding sandboxes, the pattern differs:
          `https://{account}-{sandboxName}.sandbox.{server}.luccasoftware.com`,
          where:

          - `{sandboxName}` is automatically generated upon creation.

          - `{server}` may be "eu1", "eu2" or "ch1".
security: []
tags:
  - name: Files
    description: Files.
paths:
  /lucca-files/api/uploads:
    parameters:
      - $ref: '#/components/parameters/Authorization'
    post:
      tags:
        - Files
      summary: Upload a file
      description: Upload a file.
      operationId: post-upload
      parameters:
        - name: Accept
          description: >-
            HTTP request header used for
            [content-negotiation](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Content_negotiation).
          in: header
          required: true
          schema:
            type: string
            const: application/json
        - name: Content-Type
          description: >-
            HTTP response header used for
            [content-negotiation](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Content_negotiation).
          in: header
          required: true
          schema:
            type: string
            const: multipart/form-data
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                form:
                  type: string
                  format: binary
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/File'
components:
  parameters:
    Authorization:
      name: Authorization
      required: true
      description: 'API key. Value must be formatted like so: `lucca application={api_key}`.'
      in: header
      schema:
        type: string
  schemas:
    File:
      title: File
      description: A file resource.
      type: object
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
          description: File name.
        createdAt:
          type: string
          format: date-time
          description: UTC timestamp of the moment this file was uploaded.
        deletedAt:
          description: |-
            UTC timestamp of the moment this file was deleted. When null, file
            is not deleted.
          type:
            - string
            - 'null'
        contentLength:
          type: integer
          minimum: 1
          description: File size in bytes.
        contentType:
          type: string
          enum:
            - eml message/rfc822
            - image/heic
            - image/heif
            - image/jpe
            - image/jpg
            - image/pjpeg
            - image/gif
            - image/bmp
            - image/tif
            - image/tiff
            - image/x-dcraw
            - image/x-jb2
            - image/x-jbig2
            - image/x-jpf
            - image/x-ms-bmp
            - image/x-panasonic-raw
            - image/x-pcx
            - image/x-icon
            - image/x-png
            - image/vnd.microsoft.icon
            - image/webp
            - image/x-portable-anymap
            - text/plain
            - text/csv
            - text/rtf
            - text/calendar
            - text/comma-separated-values
            - text/markdown
            - application/pdf
            - application/msword
            - application/xls
            - application/x-csv
            - application/ms-excel
            - application/vnd.ms-office
            - application/vnd.ms-word
            - application/vnd.ms-outlook
            - application/vnd.ms-powerpoint
            - application/vnd.ms-excel
            - application/vnd.oasis.opendocument.text
            - application/vnd.oasis.opendocument.spreadsheet
            - application/vnd.oasis.opendocument.presentation
            - application/vnd.oasis.opendocument.graphics
            - >-
              application/vnd.openxmlformats-officedocument.wordprocessingml.document
            - application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
            - >-
              application/vnd.openxmlformats-officedocument.presentationml.presentation
            - >-
              application/vnd.openxmlformats-officedocument.presentationml.slideshow
            - >-
              application/vnd.openxmlformats-officedocument.presentationml.template
            - application/x-7z-compressed
            - application/rar
            - application/x-rar
            - application/zip
            - application/csv
            - application/rtf
            - application/text
            - application/txt
            - application/x-pdf
        extension:
          type: string
          description: 'Inferred from content-type (e.g.: ''.pdf'', ''.doc'', ''.txt'', etc...).'
        totalPages:
          type: integer
          minimum: 0
          description: Number of pages of a document file.
      examples:
        - id: 552cb7db-b7e2-4f39-a675-c4b140f41eea
          name: test.pdf
          createdAt: '2023-10-24T12:19:54.7243377Z'
          deletedAt: null
          contentLength: 95683
          contentType: application/pdf
          extension: .pdf
          totalPages: 3

````