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

# Upload a file

> Accepts multipart/form-data with fields:
- file: binary (required)
- file_metadata: string (optional, JSON string)



## OpenAPI

````yaml https://api.chunkr.ai/docs/openapi.json post /files
openapi: 3.1.0
info:
  title: Chunkr API
  description: >-
    API service for document layout analysis and chunking to convert document
    into RAG/LLM-ready data.
  contact:
    name: Chunkr
    url: https://chunkr.ai
    email: ishaan@lumina.sh
  license:
    name: ''
  version: 2.62.0
servers:
  - url: https://api.chunkr.ai
    description: Chunkr API
security: []
tags:
  - name: Files
    description: Endpoints for uploading and managing files
  - name: Health
    description: Endpoint for checking the health of the service.
  - name: Tasks
    description: Endpoints for uploading and managing tasks
  - name: Webhook
    description: Endpoints for managing webhooks
paths:
  /files:
    post:
      tags:
        - Files
      summary: Upload a file
      description: |-
        Accepts multipart/form-data with fields:
        - file: binary (required)
        - file_metadata: string (optional, JSON string)
      operationId: upload_file_route
      requestBody:
        description: Multipart upload with file and optional metadata
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/FileUploadForm'
        required: true
      responses:
        '200':
          description: File uploaded successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FileResponse'
        '400':
          description: Bad request
          content:
            text/plain:
              schema:
                type: string
        '401':
          description: Unauthorized
          content:
            text/plain:
              schema:
                type: string
        '500':
          description: Server error
          content:
            text/plain:
              schema:
                type: string
      security:
        - api_key: []
components:
  schemas:
    FileUploadForm:
      type: object
      description: Form model for typed multipart extraction
      required:
        - file
      properties:
        file:
          type: string
          format: binary
          description: The file to upload
        file_metadata:
          type:
            - string
            - 'null'
          description: Arbitrary JSON metadata associated with the file.
    FileResponse:
      type: object
      description: |-
        Metadata describing an uploaded file in Chunkr.

        Returned by POST `/files` and GET `/files/{file_id}`.
      required:
        - file_id
        - url
        - file_name
        - content_type
        - file_size
        - metadata
        - created_at
      properties:
        content_type:
          type: string
          description: MIME type detected or provided for the file.
        created_at:
          type: string
          format: date-time
          description: Timestamp when the file was created.
        file_id:
          type: string
          description: Unique identifier for the file.
        file_name:
          type: string
          description: The original filename supplied by the client.
        file_size:
          type: integer
          format: int64
          description: Size of the stored file in bytes.
        metadata:
          type: object
          description: Arbitrary JSON metadata associated with the file.
        url:
          type: string
          description: Permanent Chunkr URL. Use directly with other chunkr API requests.
  securitySchemes:
    api_key:
      type: apiKey
      in: header
      name: Authorization

````