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

# Upload file

> Upload a file for schema extraction using a JSON payload. Either file_base64 or file_url must be provided.

If you'd like us to support a filetype that is not included, please get in touch with us at [support@kili.so](mailto:support@kili.so)


## OpenAPI

````yaml POST /upload
openapi: 3.0.1
info:
  title: tile.run API
  description: API to extract structured data from unstructured files.
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.tile.run/v1
security: []
paths:
  /upload:
    post:
      summary: Upload a file
      description: >-
        Upload a file for schema extraction using a JSON payload. Either
        file_base64 or file_url must be provided.
      operationId: uploadFile
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            format: bearer
          description: Bearer token for authentication
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                content_type:
                  type: string
                  description: Content type of the image
                  enum:
                    - application/pdf
                    - image/tiff
                    - text/plain
                    - text/csv
                    - image/png
                    - image/jpeg
                    - image/jpg
                    - image/gif
                    - image/webp
                file_base64:
                  type: string
                  format: byte
                  nullable: true
                  description: Base64-encoded file data
                file_url:
                  type: string
                  format: uri
                  nullable: true
                  description: URL of where the file can be downloaded from
              required:
                - content_type
              oneOf:
                - required:
                    - file_base64
                - required:
                    - file_url
      responses:
        '200':
          description: File uploaded successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FileUploadResponse'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: cca34f95-95a3-401b-8b33-89eb24fdcc2a
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: cca34f95-95a3-401b-8b33-89eb24fdcc2a
components:
  schemas:
    FileUploadResponse:
      type: object
      required:
        - file_id
      properties:
        file_id:
          type: string
          description: ID of the uploaded file

````