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

# Nahrát soubor

> Nahrání souboru pro použití v extrakci tabulky.

## Poznámky k použití

* Soubor odešlete jako `multipart/form-data` v poli `file`.
* Endpoint pro nahrání přijímá soubor do 1 GB. Při následném vytvoření tabulky platí přísnější limity podle formátu.
* Uložte si vrácené `id`. Předejte ho v `file_ids` při volání `POST /tables`.

Nahraný soubor je soukromý pro vaši společnost. Smazání nahraného souboru nesmaže tabulky, které ho už importovaly.


## OpenAPI

````yaml openapi.yaml POST /files
openapi: 3.1.0
info:
  title: Lasso API
  description: AI-powered product data extraction and enhancement API
  version: 1.0.0
  contact:
    name: Lasso Support
    url: https://lasso.ai
  license:
    name: MIT
    url: https://opensource.org/licenses/MIT
servers:
  - url: https://app.productlasso.com/api/v1
    description: Production
security:
  - BearerAuth: []
paths:
  /files:
    post:
      tags:
        - Files
      summary: Upload a file
      description: Upload a file for use in table extraction. Max size 1GB.
      operationId: uploadFile
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              required:
                - file
              properties:
                file:
                  type: string
                  format: binary
      responses:
        '201':
          description: Uploaded file
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/File'
        '400':
          $ref: '#/components/responses/BadRequest'
      x-codeSamples:
        - lang: bash
          label: cURL
          source: |
            curl --request POST \
              --url https://app.productlasso.com/api/v1/files \
              --header "Authorization: Bearer $LASSO_API_KEY" \
              --form "file=@supplier-products.xlsx"
        - lang: typescript
          label: TypeScript
          source: >
            import { readFile } from "node:fs/promises";


            const file = await readFile("supplier-products.xlsx");

            const form = new FormData();

            form.append(
              "file",
              new Blob([file], { type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" }),
              "supplier-products.xlsx",
            );


            const response = await
            fetch("https://app.productlasso.com/api/v1/files", {
              method: "POST",
              headers: { Authorization: `Bearer ${process.env.LASSO_API_KEY}` },
              body: form,
            });


            if (!response.ok) throw new Error(await response.text());

            const uploadedFile = await response.json();
        - lang: python
          label: Python
          source: |
            import os
            import requests

            with open("supplier-products.xlsx", "rb") as file:
                response = requests.post(
                    "https://app.productlasso.com/api/v1/files",
                    headers={"Authorization": f"Bearer {os.environ['LASSO_API_KEY']}"},
                    files={"file": ("supplier-products.xlsx", file)},
                    timeout=120,
                )

            response.raise_for_status()
            uploaded_file = response.json()
components:
  schemas:
    File:
      type: object
      required:
        - id
        - filename
        - size
        - created_at
      properties:
        id:
          type: string
          format: uuid
        filename:
          type: string
        size:
          type: integer
          description: File size in bytes
        content_type:
          type: string
        created_at:
          type: string
          format: date-time
      examples:
        - id: 4be9e43c-f03a-4309-938c-d2e9482752cf
          filename: supplier-products.xlsx
          size: 42816
          content_type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
          created_at: '2026-08-31T09:10:00.000Z'
    Error:
      type: object
      required:
        - status_code
        - error_type
        - message
        - request_id
      properties:
        status_code:
          type: integer
        error_type:
          type: string
          enum:
            - invalid_request
            - unauthenticated
            - forbidden
            - not_found
            - conflict
            - validation_error
            - rate_limited
            - service_unavailable
            - internal_error
        message:
          type: string
        request_id:
          type: string
        code:
          type: string
          description: >-
            Stable machine-readable detail code for validation, conflict, and
            retryable availability errors.
        retryable:
          type: boolean
          description: Whether the request can be retried without changing its payload.
        attribute_id:
          type: string
          format: uuid
          description: Stable Attribute identity when the error is scoped to one Attribute.
        attribute_key:
          type: string
          description: Attribute key when the error is scoped to one Attribute.
        details:
          type: object
          additionalProperties: true
        current_updated_at:
          type: string
          format: date-time
          description: >-
            Current resource revision supplied for client-directed refetch after
            a stale write.
  responses:
    BadRequest:
      description: Invalid request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.